2969 days ago
Count the frequency of base G in a given DNA sequence
#!/usr/bin/perl use strict; use warnings; my $DNA = "GATTACACAT"; #initialize $countG and $currentPos my $countG = 0; my $currentPos = 0; #calculate the length of $DNA...2969 days ago
2969 days ago
Parse a genbank file using regular expressions
...print "GI: $2\n"; } elsif (/(DEFINITION\s*)(.*)(\.)/) { print "Sequence name: $2\n"; } elsif (/(ORGANISM\s*)(.*)/) { print "Organism: $2\n"; } elsif(/...2968 days ago
2961 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) { # matched text = $& if(exists $res...2961 days ago
Needleman-Wunsch Algorithm in Perl
#!/usr/bin/perl # USAGE: perl nw.pl HEAGAWGHEE PAWHEAE BLOSUM50.txt -8 # See: "B...0 \n" unless @ARGV == 4; # get sequences, matrix and gapcost from command line my ($seq1, $seq2, $smfile, $gapcost) = @ARGV; # scoring s...2957 days ago
Perl script introduces control structures, arrays and hashes.
...$#first_array\n\n"; print "Another way of getting size: $another_way_of_getting_size_of_array\n\n"; # Control Loop: for for (my $i=0; $i 'ATCGATGCT', 'RNA'...2914 days ago
Blast script to index and extract sequence !!
...chromosome, complete genome. AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTCTC TGACAGCAGCTT...CTTTAACCAATATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTAC # generate the blast d...AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTCTCTGACAGCAGCTTCT...2904 days ago
Perl script to insert sequence in contig !!
# sub signature: #insertSEQintoCONTIGatLOC( SEQ , CONTIG , LOC ) ; sub insertSEQintoCONTIGatLOC{ my ( $SEQ , $CONTIG , $...Q ; return $CONTIG; } $s = "ATATGATGATAGATGATAGTAGATAGATAGATAGAT...= '$s' ) \n"; # OUTPUT: # s = ATATGATGATAGATGATAGTAGATAGATAGATAGAT...2760 days ago