Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit 1b584a70 authored by Anna Buschart's avatar Anna Buschart
Browse files

added testFastaExtract.pl

parent 39c3d9b1
......@@ -37,7 +37,7 @@ grep motus.processing -v metaT.mOTU.counts | cut -f 1 >> mOTUs.present
cat mOTUs.present | sort | uniq > mOTUs.present.all
```
With the help of the R script [`getValidGenes1.R`](getValidGenes1.), we then searched the mapping files _mOTU.v1.padded.motu.linkage.map_ and _mOTU.v1.map.txt_ for the genes belonging to the mOTUs found in the sample. The genes were then extracted from the marker gene collection in COG-wise fashion into a new fasta file.
With the help of the R script [`getValidGenes1.R`](getValidGenes1.R), we then searched the mapping files _mOTU.v1.padded.motu.linkage.map_ and _mOTU.v1.map.txt_ for the genes belonging to the mOTUs found in the sample. The genes were then extracted from the marker gene collection in COG-wise fashion into a new fasta file using [`testFastaExtract.pl`](testFastaExtract.pl).
```
for cog in `cut -f 3 ../../mOTU.v1.padded.motu.map | sort | uniq`
......
#!/usr/bin/perl
use Bio::DB::Fasta;
my $fastaFile = shift;
my $queryFile = shift;
my $db = Bio::DB::Fasta->new( $fastaFile );
open (IN, $queryFile);
while (<IN>){
chomp;
$seq = $_;
my $sequence = $db->seq($seq);
if (!defined( $sequence )) {
print STDERR "Sequence $seq not found. \n";
next;
}
print ">$seq\n", "$sequence\n";
}
Markdown is supported
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