2927 days ago
Find the number of each 2 consecutive characters AA, AC,AG,AT,CC,CA... with Perl
#!/usr/bin/perl -w use strict; my $subject = "AACGTACTGACGTACTGGTTGGTACGA"; my %results = (); while ($subject =~ m/[ACTG][ATGC]/g) {...2927 days ago
Generating a random string with Perl
#!/usr/bin/perl # This function generates random strings of a given length sub generate_random_string { m...{ # rand @chars will generate a random # number between 0 and scalar @chars...2925 days ago
Needleman-Wunsch Algorithm in Perl
#!/usr/bin/perl # USAGE: perl nw.pl HEAGAWGHEE PAWHEAE BLOSUM50.txt -8 # See: "Biological sequence anaysis" Durbin et a...UP 1998, Pg. 19 # Needleman-Wunsch global alignment algo (GOTHO 1982...CH scores we will use values read from BLOSUM50) my $MATCH = 1; #...2923 days ago
Count GC Content in nucleotide sequence with Perl
#!/usr/bin/perl -w ### Usage: get_gc_content.pl...( open(IN, "$fasta_file") ) { print "Got a bad fasta file: $fasta_file\n\n...line. &process_it; close(IN); close(OUT); sub usage { $0 get_gc_content...2923 days ago
Implementation of biological random mutation with Perl
#!/usr/bin/perl -w use strict; use warnings; #sequence for a better recognition my $DNA="AAAAAAAA...2919 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($l2901 days ago
Perl script to extract lines with matching ids !!
#!/usr/bin/perl use strict; use warnings; my %patterns; #USAGE: perl extactByIds.pl Idsfile1 file2 > Result # Open file and get patterns to search for open(my $fh2,"2893 days ago
Perl script to extract fasta sequence by matching name/ids !!
#!/usr/bin/perl use strict; use warnings; use Text::Trim qw(trim); #Usage perl extractSeqbyID.pl ids.txt seq.fasta Result.fasta $ARGV[2] or die "use extractSeqbyID.pl LIST FASTA OUT\n"; m...2893 days ago
Perl script to find the absolute "full" path of the file !
#!/usr/bin/perl use Cwd; my $this_file_full_path = Cwd::abs_path(__FILE__); print "$this_file_full_path\n"; use Cwd qw/ realpath /; ## $0; this script my $path = realpath($0); print $path;2897 days ago