2932 days ago
Check if your coputer ready to use BioPerl
#!/usr/bin/perl use strict; use warnings; #bioperl example code use strict; use warnings; #make the bioperl module (class) accessible to your program use Bio::Seq; print"ok - ready to use Bio::Seq";2932 days ago
Find and replace ambiguous characters in fasta file with Perl and Bioperl
#!/usr/bin/perl -w my $usage="\...". "Print out the name of sequences with characters other t..."If multiple files are given, sequences in all files are marged...my $format = "fasta"; my @seqArr = (); @ARGV = ('-') unl...f (defined($opt_m)) { my $seqOut = Bio::SeqIO->new(-fs => \...2929 days ago
2925 days ago
Count GC Content in nucleotide sequence with Perl
#!/usr/bin/perl -w ### Usage: get_gc_content.pl...otal Count\tG Count\tC Count\tA Count\tT Count\n"; $seq = ""; while () { chomp;...f (/^>/) { #finish up previous line. if (length($seq) > 0) { &process_it;...2920 days ago
Perl script to extract fasta sequence by matching name/ids !!
#!/usr/bin/perl use strict; use warnings; use Text::Trim qw(trim); #Usage perl extractSeqbyID.pl ids.txt seq.fasta Result.fasta $ARGV[2...2890 days ago
Perl script introduces control structures, arrays and hashes.
...nings; my @first_array = ('DNA', 'ATGCGTGC', 5, 'RNA', 'AUGC'); print $first_arra...for (my $i=0; $i 'ATCGATGCT', 'RNA' => 'AUGC', 'Number of seqs' => 2 ); print $sequence{'DNA'}, "\n"; # Control...2877 days ago
Extract a range from genome file with perl.
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; my $in_file = $ARGV[0]; my $start_po...; my $end_pos = $ARGV[2]; my $in = Bio::SeqIO->new ( -file => $in_file, -format => 'fasta'); my $out = Bio::SeqIO->new( -file => ">$in_file.o...2642 days ago
Perl script to insert sequence in contig !!
# sub signature: #insertSEQintoCONTIGatLOC( SEQ , CONTIG , LOC ) ; sub insertSEQintoCONTIGatLOC{ my ( $SEQ , $CONTIG , $LOC ) = @_; substr( $CONTIG , $LOC , -length($CONTIG) ) = $SEQ ; return $CONTIG; } $s...2723 days ago
2719 days ago