This is a test version of Biostars. For the public version, visit https://www.biostars.org.
perl script to generate the fastq file

i need a perl script which will generate simulated FastQ sequence files with defined sequence composition and should generate separate files with average GC content of 10,20,30..90% over a length of 50bp.

sequence

please do help me in finding the solution for the program

thanks for your time ...finally we found answer for the question ...the program is as follows:

#!/usr/bin/perl
use List::Util qw(shuffle);
my $email  = "\@ERR009148";
print "$email.1 IL26_1382:7:1:611:919 length=50\n";
$len=50;
$per=$ARGV[0];
$sum=($per/100)*$len;
$at=$len-$sum;
$sequence= "";
{
for($i=0;$i<$at; $i++)
{
 $base = int(rand(2)+1);

             if($base == 1){ $sequence .= "A";}

             elsif($base == 2){ $sequence .= "T";}
}
for($j=0;$j<$sum;$j++)
{
$base = int(rand(2)+1);
             if($base == 1){ $sequence .= "G";}

             elsif($base == 2){ $sequence .= "C";}

 }

my @ch = split //, $sequence;
my $shuffled = join '', $ch[0], shuffle(@ch[1..$#ch-1]), $ch[-1];

print $shuffled, "\n";
print "+ERR009148.1 IL26_1382:7:1:611:919 length=50\n";
print ">>>>>>>>>>>>>>>>>>>>>>>>>>>=>=9<<;2<\n";
}

0 answers

No answers yet.

Log in to answer this question.