Find and replace ambiguous characters in fasta file with Perl and Bioperl
...ter\n". "Print out the name of sequences with characters other than ATGC-.\n". "If -m is specifie...it; sub AmbiguousChar { my $string = shift; $string =~ s/[ATGC-]//g; $string =~ s/\s+...2927 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(exis...2922 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";...2914 days ago
Calculate ATGC percentage in parallel with perl
#!/usr/bin/perl use strict; use Parallel::ForkManager; use Bio::SeqIO; #usage: perl testParallel.pl my %sequences; my $seqio = Bio::SeqIO->new(-file => "$...2669 days ago
Perl script to find the distance beetween all the contigs and scaffolds
...}{len} += length $line; $sequences{$seqid}{gc} += ($line =~ tr/gcGC/gcGC/); $line =~ s/[^atgc]/N/ig; $sequences{$seqid}{nonatgc} += ($line =~ tr/N/N/);...2153 days ago
1572 days ago
Perl script to delete the adjacent repeats !
...question for bioinfomatician ! #Write a code to delete the adjacent repeated character .... $string='ATTTTTTGGC'; # This should be converted to ATGC $string =~ s/(\w)\1/$1/g; p...1563 days ago