RefFinder: Difference between revisions

From software
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
Small fast cprogram to extract bases from a fasta file. Download here [http://popgen.dk/software/download/refFinder/refFinder.tar.gz]
Small fast cprogram to extract bases from a fasta file. Download here [http://popgen.dk/software/download/refFinder/refFinder.tar.gz]
Program can either work as a standalone program, or allow for easy retrieval of reference bases by using the API.
=Install=
=Install=
<pre>
<pre>
Line 8: Line 11:
</pre>
</pre>


=Example=
=Stand alone=
==Example==


Generate samtools chr pos ref doing
Generate samtools chr pos ref doing
Line 73: Line 77:
1 13999911 g
1 13999911 g
</pre>
</pre>
=API=

Revision as of 13:42, 13 March 2014

Small fast cprogram to extract bases from a fasta file. Download here [1]

Program can either work as a standalone program, or allow for easy retrieval of reference bases by using the API.

Install

wget http://popgen.dk/software/download/refFinder/refFinder.tar.gz
cd refFinder/
make
cd ..

Stand alone

Example

Generate samtools chr pos ref doing

samtools mpileup -b smallBam.filelist -f /space/genomes/refgenomes/hg19/merged/hg19NoChr.fa |cut -f1-3 >small.sam

Use refFinder to find the bases for each position in small.sam

cut -f1-2 ../angsd/test/small.sam |./refFinder /space/genomes/refgenomes/hg19/merged/hg19NoChr.fa full >tst
cmp tst small.bam

possible options are

inputIsZero
full

These are flags, so examples are

cut -f1-2 ../angsd/test/small.sam |./refFinder /space/genomes/refgenomes/hg19/merged/hg19NoChr.fa |head
a
g
c
t
a
c
t
c
g
g

Or if we want the chr position also

cut -f1-2 ../angsd/test/small.sam |./refFinder /space/genomes/refgenomes/hg19/merged/hg19NoChr.fa full |head
1	13999902	  a
1	13999903	  g
1	13999904	  c
1	13999905	  t
1	13999906	  a
1	13999907	  c
1	13999908	  t
1	13999909	  c
1	13999910	  g
1	13999911	  g

Or if the positions are zero index as opposed to one indexed:

cut -f1-2 ../angsd/test/small.sam |./refFinder /space/genomes/refgenomes/hg19/merged/hg19NoChr.fa full inputIsZero |head
1	13999902	 g
1	13999903	 c
1	13999904	 t
1	13999905	 a
1	13999906	 c
1	13999907	 t
1	13999908	 c
1	13999909	 g
1	13999910	 g
1	13999911	 g

API