Skip to content

Commit

Permalink
fix: update htsinfer_to_tsv.py with zarp-cli compatibilities (#143)
Browse files Browse the repository at this point in the history
Co-authored-by: Máté Balajti <mate.balajti@unibas.ch>
  • Loading branch information
balajtimate and balajtimate committed May 23, 2023
1 parent cadd89d commit 27a07d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workflow/scripts/htsinfer_to_tsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def should_i_flag(df, sample, param):
user_param = df.loc[sample,param]
except KeyError:
user_param = np.nan
if np.isnan(user_param):
if pd.isna(user_param):
e_flag = True

LOGGER.debug(f"flag after: {e_flag}")
Expand Down Expand Up @@ -174,8 +174,8 @@ def htsinfer_to_zarp(sample,jparams, samples_df):
LOGGER.warning("No 3p adapter for fq2 identified, no adapters will be removed.")

# organism
org1 = jparams.library_source.file_1.short_name
org2 = jparams.library_source.file_2.short_name
org1 = jparams.library_source.file_1.taxon_id
org2 = jparams.library_source.file_2.taxon_id
tparams["organism"] = None

# source could not be inferred
Expand Down Expand Up @@ -225,7 +225,7 @@ def htsinfer_to_zarp(sample,jparams, samples_df):
read_lengths.append(jparams.library_stats.file_1.read_length.max)
read_lengths.append(jparams.library_stats.file_2.read_length.max)
if (read_lengths is not None) and (len(read_lengths) != 0):
tparams["index_size"] = max([int(i) for i in read_lengths if i is not None])
tparams["index_size"] = max([int(i) for i in read_lengths if i is not None], default=0)
else:
LOGGER.error("Read lengths (=index_size) could not be determined")

Expand Down

0 comments on commit 27a07d9

Please sign in to comment.