Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

programme to get the sequence with cut ends of 250 bp on both sides and also i need to get the cut pieces please suggest the rigght way

by anisha3 (Novice)
on Mar 22, 2012 at 12:06 UTC ( #960989=perlquestion: print w/ replies, xml ) Need Help??
anisha3 has asked for the wisdom of the Perl Monks concerning the following question:

this is the one which i wrote by myself if its wrong plz letme knw <\p> <code> @chromosome = <CHROMOSOMEFILE>; close CHROMOSOMEFILE; shift (@chromosome); $chromosome = join( '', @chromosome); $chromosome =~ s/\s//g; $length = length ($chromosome); #print "len ::$length\n"; $startpos= 0; $endpos = 100000; $total_count=0; for($i=0;$i<=$length; $i += 100000) { $sublen=$endpos-$startpos; $frag=undef; $frag = substr($chromosome, $startpos,$sublen); print OF "$frag\n"; #@chromosome = split ( '250\n', $chromosome); ; $startpos += 100000; $endpos +=100000; } print OF "Total number of positions:: $total_count\n"; exit; <\code>

Comment on programme to get the sequence with cut ends of 250 bp on both sides and also i need to get the cut pieces please suggest the rigght way
Re: perl programme to sort out snps from human genome ....plz suggest me the right way . iam confused how to write
by marto (Chancellor) on Mar 22, 2012 at 13:33 UTC

    "this is the one which i wrote by myself if its wrong plz letme knw"

    I'm sure if you ran your script you'd see it was wrong, in the sense that it doesn't work. Here is an example which does what I think you are trying to do:

    #!/usr/bin/perl use strict; use warnings; my $word1 = 'Hcr1fa.fa'; # you missed the ; if ( $word1 eq "chr1.subst.fa" ){ # I added quotes print "$word1\n"; } elsif ( $word1 eq "Hcr1fa.fa" ) { print "$word1\n" }

    Now I'm sure you know what you're trying to achieve with your code, I don't. My code prints the value of $word1 if the value is "chr1.subst.fa" or "Hcr1fa.fa". You'll see from the code and the comments that I added quotes around chr1.subst.fa, are you expecting this string or are you trying to match something else?

    When you previewed your post, you must have seen that something was wrong with the formatting. Your closing code tag should be </code> rather than <\code>.

    Here are some links I think you should read and understand:

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://960989]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-11-29 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (204 votes), past polls