处理contig合并后有序列名相同的问题

做binning的时候遇到这个问题:

 Exception occured when parsing file temp/contig/all_contigs.fa
Traceback (most recent call last):
  File "/home/changyixiao/soft/vamb-master/src/concatenate.py", line 59, in
    vamb.vambtools.concatenate_fasta(
  File "/home/changyixiao/soft/vamb-master/vamb/vambtools.py", line 588, in concatenate_fasta
    raise e from None
  File "/home/changyixiao/soft/vamb-master/vamb/vambtools.py", line 580, in concatenate_fasta
    raise ValueError(
ValueError: Multiple sequences would be given identifier "S1Ck141_461543".

把第二个修改成_2

(base) [changyixiao@loginnode01 zd0724]$ grep -n 'k141_461543' temp/contig/all.fa
268817:>k141_461543 flag=1 multi=3.0000 len=2086
1614507:>k141_461543 flag=1 multi=8.0000 len=22393
(base) [changyixiao@loginnode01 zd0724]$ cp temp/contig/all.fa temp/all.backup.fa
(base) [changyixiao@loginnode01 zd0724]$ sed '1614507s/k141_461543/k141_461543_2/' -i t
emp/contig/all.fa(base) [changyixiao@loginnode01 zd0724]$ grep -n 'S1Ck141_461543' temp/contig/all.fa
(base) [changyixiao@loginnode01 zd0724]$ grep -n 'k141_461543' temp/contig/all.fa
268817:>k141_461543 flag=1 multi=3.0000 len=2086
1614507:>k141_461543_2 flag=1 multi=8.0000 len=22393

你可能感兴趣的:(服务器)