2937 days ago
2936 days ago
Generating a random string with Perl
#!/usr/bin/perl # This function generates random strings of a given length sub generate_random_string { my $length_of_randomstring=sh...# the length of # the random string to generate my @chars=('a...een 0 and scalar @chars $random_string.=$chars[rand @chars]; } r...2934 days ago
Implementation of biological random mutation with Perl
#!/usr/bin/perl -w use strict; use warnings; #sequence for a better recognition my $DNA="AAAAAAAAAAAAAAAAAAAAAAAAAAAA...srand (time | $$). $mutant=mutate ($DNA); print "Mutate \ n". $DNA...DNA \ n"; print "Here is the mutant DNA: \...2928 days ago
Perl script to generate a random psuedo DNA sequence !
#!/usr/bin/perl print "Enter a number of nucleotides: \n"; chomp ($N = ); @b=qw/A T G C/;print ">Genome\n";while($l2910 days ago
Perl subroutine to read and write files
# Input output (InOut) the file # usage: # @array = InOut('read',$file) # $string = InOut('read',$file) # InOut('write',$file,\$string) # InOut('write',$file,\@arr...2892 days ago
Perl script introduces control structures, arrays and hashes.
#!/usr/bin/env perl use strict; use warnings; my @first_array = ('DNA', 'ATGCGTGC', 5, 'RNA', 'AUGC'); print $first_array[0], "\n\n";...'Number of seqs' => 2 ); print $sequence{'DNA'},...2889 days ago
2720 days ago
Perl script to insert the DNA string in genome
#!/usr/bin/perl use warnings; use strict; use Bio::SeqIO; use Bio::Seq; my $file = $ARGV[0]; # input fas...eq => $upstream.$seqI.$downstream,-display_id => $seq->primary_id,-alphabet => "dna" )...2686 days ago
Calculate ATGC percentage in parallel with perl
#!/usr/bin/perl use strict; use Parallel::ForkManager; use Bio::SeqIO; #usage: perl testParall...y is out of the pool!\n"; sub checkATCG { my $name=shift; my $DNA=$sequences{$name}; my $length=length $DNA;...2683 days ago