grenaud / glactools

command-line tools for the management of genotype likelihoods and allele counts
http://grenaud.github.io/glactools/
GNU General Public License v3.0
28 stars 2 forks source link

SQ fields differ in the header #17

Closed coopergrace closed 4 years ago

coopergrace commented 4 years ago

Dear Gabriel,

I'm receiving the following error when attempting to use replaceanc: $ glactools replaceanc chr1.pops.acf.gz chr1.ancroot.acf.gz > ancrooted.chr1.acf.gz

GlacReplaceAncestor: The SQ fields differ in the header, are they from the same reference?

Is there a way to override or force glactools to accept that the references are the same, or to use one over the other? The reference genomes I used were the same sequences, but with differing sequence names - I had to shorten the names whilst generating the ancestral and root vcfs and that may be causing this issue downstream.

Failing that, is there a way to manually edit the headers of acf files?

Cheers

Cooper

grenaud commented 4 years ago

Dear Cooper, If you 100% that the references are the same except that the chr names have different names, just use: "glactools reheader".

You can actually use file descriptors as such:

glactools replaceanc chr1.pops.acf.gz <(glactools reheader -u chr1.ancroot.acf.gz newheader.txt) > ancrooted.chr1.acf.gz

The -u is to produce uncompressed, there is no point in compressing then decompressing :-)