Needleman-Wunsch Algorithm in Perl
...atch my $MISMATCH = -1; # -1 for letters that mismatch my $GAP = $gapcost; # for any gap my %BLOSUM50 = (); my @aalist = (); # read substitution matrix open in, $smfile...2962 days ago
Count GC Content in nucleotide sequence with Perl
...--------------------------- #Deal with passed parameters #--------...#ARGV == -1) { usage(); exit; } $fasta_file = $ARGV[0];...ouldn't create $out_file\n"; exit; } print "Parameters:\nfast...#finish up last line. &process_it; close(IN); close(OUT);...2962 days ago
Implementation of biological random mutation with Perl
#!/usr/bin/perl -w use strict; use warnings; #sequence for a better recognition my $DNA="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA \ n"; my $I; m...2958 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,"2932 days ago
Perl script to extract fasta sequence by matching name/ids !!
...hile () { chomp; next if /^\s*$/; s/>//g; my @ids=split (/\t/, $_); $select{$ids...fasta" or die; while () { trim($_); s/>//g; my ($id) = split (/\n/, $_); #my @i=split...2932 days ago
2928 days ago
2928 days ago
2928 days ago
Perl subroutine to read and write files
...InOut('read',$file) # $string = InOut('read',$file) # InOut('write',$file,\$string) # InOut('write',$file,\@array) #$string =...t',\$string); sub InOut { my($bit,$file,$data) = @_; if($bit eq 'read'){ open InOut,"...2922 days ago
Perl script introduces control structures, arrays and hashes.
...Scalar gives actual size of an array my $size_of_array = scalar(@first_array); my $another_way_of_getting_size_of_array = @first_array; # implicit way print "Scalar of array:...2919 days ago