Needleman-Wunsch Algorithm in Perl
...rl # USAGE: perl nw.pl HEAGAWGHEE PAWHEAE BLOSUM50.txt -8 # See: "Bio...s @ARGV == 4; # get sequences, matrix and gapcost from command line my ($seq1...d MISMATCH scores we will use values read from BLOSUM50) my $MATCH = 1; # +1...2910 days ago
Count GC Content in nucleotide sequence with Perl
...$id =~ s/^>(.+?)\s.+$/$1/g; print OUT "$id\t"; } else { $seq = $seq . $_; } } #finish up last line. &process_it; close(IN); close(OUT); sub usage { $0...2910 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";...2906 days ago
Perl script to extract fasta sequence by matching name/ids !!
...$ids[0]} = 1; } my $size = keys %select; print "Total Ids $size\n"; close LINE; $/ = "\n>"; open O...0751 circular cases print OUT ">$_" if (defined $select{$id}); } close FILE; close OUT;2879 days ago
Perl subroutine to read and write files
...ile" or die "Cannot open $file for input: $!\n"; my @file = ; close InOut; return wantarray...ef $data eq 'ARRAY' ? @$data : ref $data eq "SCALAR"? $$data : ''; close InOut; } }2870 days ago
Blast script to index and extract sequence !!
...1353.1 Escherichia coli O157:H7 str. EC4115 chromosome, complete genome. AGCTTTT...1353.1 Escherichia coli O157:H7 str. EC4115 chromosome, complete genome AGCTTTTC...00-105 Escherichia coli O157:H7 str. EC4115 chromosome, complete genome TTAAAA2856 days ago
2697 days ago
2697 days ago
Perl script to insert the DNA string in genome
...out = $ARGV[1]; # output fasta file my $chr="test"; #insertion chromosome my $pos=10; # position of the inserti...= length($seq->seq); my $upstream=substr($seq->seq, 0, $pos); my $downstream=sub...2663 days ago
Extract a range from genome file with perl.
...warnings; use Bio::SeqIO; my $in_file = $ARGV[0]; my $start_pos = $ARGV[1]; my $end_pos = $ARGV[2]; my $in = Bio::..._seq() ) { $seq->display_id( $seq->display_id() . "_$start_pos-$end_pos" ); $out->write...2631 days ago