MasonLab/InSilicoReads

From Icbwiki

Jump to: navigation, search

How to create mock reads from a FASTA file:

cat HPV6b.fa | grep -v ">" | perl -ne 'chomp;print' | perl -ne '$bases="ATCG"; $s=$_; $l=length($s); $r=100; for ($i=1; $i<=1000000; $i++) {$pos=int(rand($l-$r-1)); $read=substr($s,$pos,$r); for ($j=0; $j<length($read); $j++) {if (rand()<0.001) {substr($read,$j,1)=substr($bases,int(rand(4)),1)}}; print ">$i"."_HPV6b\n".$read."\n"}'

Personal tools