Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions loompy/bus_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def load_sample_metadata(path: str, sample_id: str) -> Dict[str, str]:
else:
result = {}
with open(path) as f:
headers = [x.lower() for x in f.readline()[:-1].split("\t")]
headers = [x.lower() for x in f.readline()[:-1].split(",")]
if "sampleid" not in headers and 'name' not in headers:
raise ValueError("Required column 'SampleID' or 'Name' not found in sample metadata file")
if "sampleid" in headers:
Expand All @@ -142,7 +142,7 @@ def load_sample_metadata(path: str, sample_id: str) -> Dict[str, str]:
sample_metadata_key_idx = headers.index("name")
sample_found = False
for line in f:
items = line[:-1].split("\t")
items = line[:-1].split(",")
if len(items) > sample_metadata_key_idx and items[sample_metadata_key_idx] == sample_id:
for i, item in enumerate(items):
result[headers[i]] = item
Expand Down