2924 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 my...2924 days ago
2924 days ago
Read lines from input file – print lines that match a regular expression
...chomp $line; if ($line =~ /^ATG?C*[ATCG]+?A{3,10}$/) { print "$line\n"; } } exit(); __DATA__ ATGCCCAA ATGCCCAAAA ATGCCCAAAAAAAAAAAAAAAAA...2924 days ago
Parse a genbank file using regular expressions
#! /usr/local/bin/perl -w $genbank = "genbank_file.txt"; open (GENBANK, $genbank) || die "cannot open $gb_report for readi...2924 days ago
BioPerl to convert between sequence formats from Fasta to Genbank
#!/usr/local/bin/perl -w # Sequence formats to choose: Fasta, EMBL. GenBank, Swissprot, PIR and GCG use Bio::SeqIO; $inFile = "BRCA2.fa"; $in = Bio::SeqIO->n...2923 days ago
2923 days ago
Perl script to Mutate a DNA Sequence
#!/usr/local/bin/perl -w # This script randomly mutates the DNA sequence and generates...; chomp $dnafilename; unless ( open(DNAFILE, $dnafilename) ) { print "Cannot open file \"$dnafilename\...2923 days ago
Perl script to count the number of Adenine, Thymine, Guanine and Cytosine in your DNA Sequence
#!/usr/local/bin/perl -w # While executing this script it asks for the file name of the..., $dna_filename) ) { print "Sorry the file does not exist!!! \n"; print "Cannot open file \"$dna_filename...2923 days ago
Retrieve NCBI GenBank records with a range of accession numbers
...use Getopt::Long; use LWP::Simple; use URI::Escape; use LWP::UserAgent; us...( $param{returnType} ); $param{query} = uri_escape( $param{query} ); _doSea..." . $param{outputFile} ) or die("Error: Cannot open $param{outputFile} :...2923 days ago