Hi All,
I am running freebayes as:
freebayes -f Gasterosteus_aculeatus.BROADS1.dna.toplevel.fa -C 5 -L p1list.txt --populations p1pops.txt> plate1.vcf
with p1list.txt (the path is the same for all files):
/path/to/S-176.sorted.bam
/path/to/S-177.sorted.bam
/path/to/S-178.sorted.bam
/path/to/S-179.sorted.bam
/path/to/S-180.sorted.bam
/path/to/S-181.sorted.bam
/path/to/S-182.sorted.bam
/path/to/S-184.sorted.bam
/path/to/S-185.sorted.bam
/path/to/S-186.sorted.bam
...
and p1pops.txt:
S-176.sorted pop1
S-177.sorted pop1
S-178.sorted pop1
S-179.sorted pop1
S-180.sorted pop1
S-181.sorted pop2
S-182.sorted pop2
S-184.sorted pop2
S-185.sorted pop2
S-186.sorted pop2
...
yet if I do
awk '{if ($1 == "#CHROM"){print NF-9; exit}}' plate1.vcf
1
which means most of my samples have been ignored or discarded. Freebayes is version: v1.2.0-2-g29c4002.
I'd be grateful for any idea of what is going on.
With yourI you havent't passed a sample name via ReadGroup during alignment, freebayes will just enumerate them. I guess this is not what you like to do?awk
command, you just print out the content of the 9th column before the last column, in the line where the first column is#CHROM
. Saying this you will print out the sample name of the first sample in your vcf.fin swimmer
EDIT: Sorry, your command should print the number of samples and not the content of the column. Therefore there had to in
$
.are you saying I should have set a ReadGroup tag to each bam file (corresponding to the IDs in the populations file?) for freebayes to correctly ID the bam files as belonging to different IDs?
This would be best-practice, yes. But it isn't neccessary.
What's the output of:
fin swimmer
Ok, I tried to add RG tags and it is just basically a fail. I can add tags, but freebayes still does not like them. Given a file for ID x
adds a tag (at least, I can see a tag in the file and I get no error), but to no avail:
so either there is no pleasing freebayes or samtools is not adding all the tags I am specifying.
What's the output from:
and
?
Have you used
x.bam
in yourfreebayes
command?fin swimmer
technically I used not just x.bam but w whole lot of bams (sorted) generated by bowtie2. Using a real sample name:
Here the sample name is missing. If you really used the command you used above this line should look like this:
(Or whatever you take for
x
)Try using
'
around the the values in thesamtools
command (even if it wasn't necessary in my test)fin swimmer
and