Skip to content
Snippets Groups Projects
Commit 848ebdfc authored by Simon Potter's avatar Simon Potter
Browse files

yet another really useful script

parent 8fc50db7
No related branches found
No related tags found
No related merge requests found
# get consensus seqs from RM libraries to load into
# repeat_consensus table
use Bio::SeqIO;
# location of RepeatMasker libs
$dir = '/path/to/RepeatMasker/Libraries/';
foreach $file (glob "$dir/*.lib") {
open LIB, "< $file";
my $seqio = Bio::SeqIO->new(
-fh => \*LIB,
-format => 'fasta'
);
while (my $seq = $seqio->next_seq) {
my $head = $seq->id;
my ($name, $class) = $head =~ m!(\S+)#(\S+)!;
unless ($name && $class) {
print STDERR "Dodgy $file:$id\n";
next;
}
print join("\t", $name, $class, $seq->seq), "\n";
}
close LIB;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment