brentp / bwa-meth

fast and accurate alignment of BS-Seq reads using bwa-mem and a 3-letter genome
https://arxiv.org/abs/1401.1129
MIT License
144 stars 54 forks source link

broken pipeline #78

Closed WRui closed 2 years ago

WRui commented 2 years ago

I use the same bashrc setting in three servers, the code can be run successfully, but showed a broken pipeline in one server. The samtools(samtools-1.14), python(python3.9) and bwameth all the same. I have no idea what is happening, looking for your help, Thank you.

==================================================
Found BWA MEM2 index
running: /drive3/ruiwr/Software/Anaconda3/bin/python /drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py c2t /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R1.good.fq.gz /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R2.good.fq.gz |bwa-mem2 mem -T 40 -B 2 -L 10 -CM -U 100 -p -R '@RG\tID:LDCT159-N1_Normal_R.good\tSM:LDCT159-N1_Normal_R.good' -t 4  /drive3/ruiwr/Database/hg19/hg19_lambda_puc19_bwameth_mem2/hg19_lambda_puc19.fa.bwameth.c2t /dev/stdin
--------------------
converting reads in /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R1.good.fq.gz,/drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R2.good.fq.gz

Please verify that both the operating system and the processor support Intel(R) X87, CMOV, MMX, FXSAVE, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, MOVBE, POPCNT, F16C, AVX, FMA, BMI, LZCNT and AVX2 instructions.

Traceback (most recent call last):
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 560, in <module>
    main(sys.argv[1:])
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 518, in main
    sys.exit(convert_reads(args[1], args[2]))
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 144, in convert_reads
    convert_and_write_read(name,seq,qual,read_i%2,out)
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 177, in convert_and_write_read
    out.write("".join((name, seq, "\n+\n", qual)))
BrokenPipeError: [Errno 32] Broken pipe
cmd was:/drive3/ruiwr/Software/Anaconda3/bin/python /drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py c2t /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R1.good.fq.gz /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R2.good.fq.gz |bwa-mem2 mem -T 40 -B 2 -L 10 -CM -U 100 -p -R '@RG\tID:LDCT159-N1_Normal_R.good\tSM:LDCT159-N1_Normal_R.good' -t 4  /drive3/ruiwr/Database/hg19/hg19_lambda_puc19_bwameth_mem2/hg19_lambda_puc19.fa.bwameth.c2t /dev/stdin
return code was:1
Traceback (most recent call last):
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 560, in <module>
    main(sys.argv[1:])
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 551, in main
    bwa_mem(args.reference, conv_fqs_cmd, ' '.join(map(str, pass_through_args)),
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 371, in bwa_mem
    as_bam(cmd, fa, set_as_failed, do_not_penalize_chimeras)
  File "/drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py", line 383, in as_bam
    for line in sam_iter:
  File "/drive3/ruiwr/Software/Anaconda3/lib/python3.9/site-packages/toolshed/files.py", line 61, in process_iter
    raise ProcessException(cmd)
toolshed.files.ProcessException: /drive3/ruiwr/Software/Anaconda3/bin/python /drive3/ruiwr/Software/bwa-meth-master/bwameth_mem2.py c2t /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R1.good.fq.gz /drive3/ruiwr/Project/cfDNA_Meth/01.clean_data/LDCT159-N1_Normal_R2.good.fq.gz |bwa-mem2 mem -T 40 -B 2 -L 10 -CM -U 100 -p -R '@RG\tID:LDCT159-N1_Normal_R.good\tSM:LDCT159-N1_Normal_R.good' -t 4  /drive3/ruiwr/Database/hg19/hg19_lambda_puc19_bwameth_mem2/hg19_lambda_puc19.fa.bwameth.c2t /dev/stdin
[main_samview] fail to read the header from "-".
samtools sort: failed to read header from "-"
brentp commented 2 years ago

Hi, here is the relevant error:

Please verify that both the operating system and the processor support Intel(R) X87, CMOV, MMX, FXSAVE, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, MOVBE, POPCNT, F16C, AVX, FMA, BMI, LZCNT and AVX2 instructions.

this means that server does not support those instructions so you cant use bwa-mem2

WRui commented 2 years ago

Thank you for you reply, do you have some recommendations to run the bwa-meth mem2 with an AMD EPYC(Milan 7763) processor. Here are the flags of the processor:

fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm art rep_good nopl extd_apicid eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single retpoline_amd ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat umip pku ospke vaes vpclmulqdq spec_ctrl intel_stibp arch_capabilities

brentp commented 2 years ago

Hi, I'm not sure what the problem is except it seems that your bwa mem2 does not work on your processor. You could verify this by trying to run bwa-mem2 directly, outside of bwa-meth. Either way, you could also run bwa-meth.py with the normal bwa mem.