Skip to content

Commit

Permalink
Splitting in case of absent sam columns content fix
Browse files Browse the repository at this point in the history
  • Loading branch information
agalitsyna committed Oct 4, 2022
1 parent 58bcc5a commit 16ffd69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pairtools/cli/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def split_py(pairsam_path, output_pairs, output_sam, **kwargs):
header, "columns", " ".join(columns)
)
has_sams = True
elif ("sam1" in columns) != ("sam1" in columns):
elif ("sam1" in columns) != ("sam2" in columns):
raise ValueError(
"According to the #columns header field only one sam entry is present"
)
Expand All @@ -113,7 +113,7 @@ def split_py(pairsam_path, output_pairs, output_sam, **kwargs):
sam1 = None
sam2 = None
for line in body_stream:
cols = line.rstrip().split(pairsam_format.PAIRSAM_SEP)
cols = line.split(pairsam_format.PAIRSAM_SEP)
if has_sams:
if sam1col < sam2col:
sam2 = cols.pop(sam2col)
Expand Down

0 comments on commit 16ffd69

Please sign in to comment.