Change sequence ID in fastq file generated by bcftools mpileup
0
0
Entering edit mode
12 months ago

Hi everobody !

I'm currently work on a HHV8 genetic study and I face to an issue with my bcftools command. Indeed, I want to generate consensus sequences thanks bcftools mpileup command and bam files. However, all ID get the ID of the reference sequence. You can see bellow the code used to do this job:

for patient in patients:
    input_file = os.path.join("Queries_seq/bam_files", patient + ".bam")
    output_file = os.path.join("Queries_seq/consensus/fastq", patient + ".fastq")
    os.system(f"bcftools mpileup -f Ref_seq/HHV8_ref.fasta {input_file} | \
        bcftools call -c | \
        vcfutils.pl vcf2fq > {output_file}")

So, if I do the linux command bellow on a randomly chosen file, I get:

sed '1,1p' Queries_seq/consensus/fastq/1G_S15.fastq
@NC_009333.1

This is the ID of my reference sequence. Can you help me to fix it ?

Best regards

bcftools • 596 views
ADD COMMENT
2
Entering edit mode

Bcftools annotate has a function rename-chr https://samtools.github.io/bcftools/bcftools.html#annotate.

You can pipe that after the bcftools call. ... bcftools call -c | bcftools annotate --rename-chrs myrenamefile.txt | ...

ADD REPLY

Login before adding your answer.

Traffic: 2044 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6