Here is a small program to shred contigs into 1kb reads with 500 base pair overlap:
#!/usr/bin/perl
open FILE1, $ARGV[0] or die $!;
while($line1 =
my $flag=0,$overlap=500,$length=1000;
chomp($line1);
$line2 =
$seqlen=length $line2;
chomp($line2);
while(($seqlen-$flag)>$length){
if(($seqlen-($flag+$overlap))<$length){
$length=$seqlen-$flag;
}
$nextseq=substr $line2,$flag,$length;
print $line1.":".$flag."-".($flag+$length)."\n";
print $nextseq."\n";
$flag=$flag+$overlap;
}#end of seqlen while loop
}#end of file while loop
This script works on a multifasta file with header in the first line and the sequence in the second line.
6 comments:
Nice post, kind of drawn out though. Really good subject matter though.
Wow, that's crazy man. They should really try to do something to fix that.
Nice post, kind of drawn out though. Really good subject matter though.
there are some error at
$line1 =
$line2 =
can you suggest something
the filehandle symbols has been eaten by html. It needs to written with css to be visible.
$line1 =
$line2 =
To see whats there in the two lines:
right-click on page >> view source >> look for $line1
Post a Comment