加入如果两端都没有-对齐时候产生的错误ali文件问题
This commit is contained in:
@@ -46,7 +46,7 @@ class PDBModeler:
|
|||||||
trim_index = 1
|
trim_index = 1
|
||||||
else:
|
else:
|
||||||
# 如果两条链都不需要裁剪,就直接返回原文件
|
# 如果两条链都不需要裁剪,就直接返回原文件
|
||||||
return file
|
return None
|
||||||
|
|
||||||
start, end = PDBModeler.find_non_dash_indices(seqs[trim_index].seq)
|
start, end = PDBModeler.find_non_dash_indices(seqs[trim_index].seq)
|
||||||
|
|
||||||
@@ -92,11 +92,11 @@ class PDBModeler:
|
|||||||
# save alignment in FASTA format
|
# save alignment in FASTA format
|
||||||
aln.write(file=(self.outdir / 'alignment1.fasta').as_posix(), alignment_format='FASTA')
|
aln.write(file=(self.outdir / 'alignment1.fasta').as_posix(), alignment_format='FASTA')
|
||||||
slice_fasta = PDBModeler.align_sequences(self.outdir / 'alignment1.fasta')
|
slice_fasta = PDBModeler.align_sequences(self.outdir / 'alignment1.fasta')
|
||||||
|
if slice_fasta:
|
||||||
slice_ali = self.outdir / 'alignment_slice.ali'
|
slice_ali = self.outdir / 'alignment_slice.ali'
|
||||||
fx = pyfastx.Fasta(slice_fasta.as_posix(), build_index=True)
|
fx = pyfastx.Fasta(slice_fasta.as_posix(), build_index=True)
|
||||||
assert len(fx) == 1, "FASTA file should contain only one sequence"
|
assert len(fx) == 1, "FASTA file should contain only one sequence"
|
||||||
PDBModeler.write_ali(slice_ali, fx[0].name, fx[0].seq)
|
PDBModeler.write_ali(slice_ali, fx[0].name, fx[0].seq)
|
||||||
|
|
||||||
env2 = Environ()
|
env2 = Environ()
|
||||||
mdl2 = Model(env2, file=self.structure_file.as_posix(), model_segment=(f'FIRST:{self.chain}', f'LAST:{self.chain}'))
|
mdl2 = Model(env2, file=self.structure_file.as_posix(), model_segment=(f'FIRST:{self.chain}', f'LAST:{self.chain}'))
|
||||||
aln2 = Alignment(env2)
|
aln2 = Alignment(env2)
|
||||||
|
|||||||
Reference in New Issue
Block a user