Needleman-Wunsch Algorithm in Perl
...H = -1; # -1 for letters that mismatch my $GAP = $gapcost; # for any gap my %BLOSUM50 = (); my @aalist = (); # read substitution matrix open in, $smfile; while(){ i...2901 days ago
Count GC Content in nucleotide sequence with Perl
...exit; } $fasta_file = $ARGV[0]; $out_file = "gc_out.txt"; unless ( open(IN, "$fasta_file") ) {...print "Got a bad fasta file: $fasta_file\n\n"; exit; } unless ( open(OUT, ">$out_file") ) { p...2901 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,"2870 days ago
Perl script to extract fasta sequence by matching name/ids !!
...@ARGV; my $fasta = shift @ARGV; my $out = shift @ARGV; my %select; open LINE, "$list" or die; while...= keys %select; print "Total Ids $size\n"; close LINE; $/ = "\n>"; open OUT, ">$out" or die; open FI...2870 days ago
2867 days ago
Perl subroutine to read and write files
...) #$string = "YO!"; #InOut('write','file.txt',\$string); sub InOut { my($bit,$file,$data) = @_; if($bit eq 'read'){ open InOut,"< $file" or die "Cannot open $file for input: $!\n";...2861 days ago
Install ATOM editor on Elemantory OS / Ubuntu
...all, delete, dev, develop, disable, docs, enable, erase, featured, home, i, init, install, link, linked, links, list, ln, lns, login, ls, open, outdated, prune, publish, re...1171 days ago
2688 days ago
2688 days ago
Extract ids from file with perl
...or}; ############################################################ #Open and Read a file sub read_fh...= shift @_; my $filehandle; if ($filename =~ /gz$/) { open $filehandle, "gunzip -dc $fil...2604 days ago