Skip to content

Commit

Permalink
Merge pull request #9 from RuiWang1998/main
Browse files Browse the repository at this point in the history
fixed a bug with Windows path, and slightly modified how we treat fas…
  • Loading branch information
xiwen1995 authored Aug 6, 2022
2 parents 764033f + 85d1232 commit d20ade0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import os
import os.path
import pathlib
import sys
import typing

from Bio import PDB as PDB
Expand Down Expand Up @@ -112,9 +113,9 @@ def fasta2inputs(
for line in lines:
if len(line) == 0:
continue
if line.startswith(">") or line .startswith(":"):
if line.startswith(">") or line.startswith(":"):
name = True
chain_ids.append(line.strip(">").strip("\n"))
chain_ids.append(line[1:].strip("\n"))
else:
if name:
aastr.append(line.strip("\n").upper())
Expand All @@ -129,7 +130,10 @@ def fasta2inputs(
folder_name = path_leaf(fasta_path).split(".")[0]
output_dir = os.path.join(parent, folder_name)
os.makedirs(output_dir, exist_ok=True)
name_max = os.pathconf(output_dir, 'PC_NAME_MAX') - 4
if sys.path == 'win32':
name_max = 100
else:
name_max = os.pathconf(output_dir, 'PC_NAME_MAX') - 4

for i, (ch, fas) in enumerate(combined):
fas = fas.replace("Z", "E").replace("B", "D").replace("U", "C")
Expand Down

0 comments on commit d20ade0

Please sign in to comment.