Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main_samview] fail to read the header from "-" #126

Open
kishor2019 opened this issue Dec 26, 2023 · 1 comment
Open

[main_samview] fail to read the header from "-" #126

kishor2019 opened this issue Dec 26, 2023 · 1 comment

Comments

@kishor2019
Copy link

Bash script:

#Set input and parameters
round=2
threads=20
read1=/mnt/disk2/Lab_Users/KISHOR/mnspt4/tenili_reseq_50x/X101SC23121795-Z01-J001/00.CleanData/3157_3/3157_3_1.clean.fq.gz
read2=/mnt/disk2/Lab_Users/KISHOR/mnspt4/tenili_reseq_50x/X101SC23121795-Z01-J001/00.CleanData/3157_3/3157_3_2.clean.fq.gz
input=/mnt/disk2/Lab_Users/KISHOR/mnspt4/assembly_annotation/NECAT/manual/tenili.fa
for ((i=1; i<=${round};i++)); do
#step 1:
#index the genome file and do alignment
bwa index ${input};
bwa mem -t ${threads} ${input} ${read1} ${read2}|samtools view --threads 3 -F 0x4 -b -|samtools fixmate -m --threads 3 - -|samtools sort -m 2g --threads 5 -|samtools markdup --threads 5 -r - sgs.sort.bam
#index bam and genome files
samtools index -@ ${threads} sgs.sort.bam;
samtools faidx ${input};
(base)[room@black01 manual]$
python /mnt/genome3/Lab_Users/Kishor/DISK_2/softwares/NextPolish/lib/nextpolish1.py -g ${input} -t 1 -p ${threads} -s sgs.sort.bam > tenili.polishtemp.fa;
input=tenili.polishtemp.fa;
#step2:
#index genome file and do alignment
bwa index ${input};
bwa mem -t ${threads} ${input} ${read1} ${read2}|samtools view --threads 3 -F 0x4 -b -|samtools fixmate -m --threads 3 - -|samtools sort -m 2g --threads 5 -|samtools markdup --threads 5 -r - sgs.sort.bam
#index bam and genome files
samtools index -@ ${threads} sgs.sort.bam;
samtools faidx ${input};
#polish genome file
pythonn /mnt/genome3/Lab_Users/Kishor/DISK_2/softwares/NextPolish/lib/nextpolish1.py -g ${input} -t 2 -p ${threads} -s sgs.sort.bam > tenili.nextpolish.fa;
input=tenili.nextpolish.fa;
done;
#Finally polished genome file: tenili.nextpolish.fa

Error text:

[main_samview] fail to read the header from "-".
[bam_mating_core] ERROR: Couldn't read header
samtools sort: failed to read header from "-"
[markdup] error reading header
samtools index: "sgs.sort.bam" is in a format that cannot be usefully indexed
[faidx] Could not build fai index tenili.polishtemp.fa.fai

Can i have please have any help to solve this issue?

@moold
Copy link
Member

moold commented Dec 26, 2023

I think you can try to update samtools to the lastest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants