Skip to content

Commit

Permalink
Fix batch mode pandas warning. (#70) (pinellolab#429)
Browse files Browse the repository at this point in the history
* refactor to call method on DataFrame, rather than Series.
Removes warning.

* Fix pandas future warning in CRISPRessoWGS

---------

Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com>
  • Loading branch information
Colelyman and mbowcut2 authored May 1, 2024
1 parent 1bc9e90 commit 340a4e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoBatchCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def main():
batch_params[arg] = getattr(args, arg)
else:
if (getattr(args, arg) is not None):
batch_params[arg].fillna(value=getattr(args, arg), inplace=True)
batch_params.fillna(value={arg: getattr(args, arg)}, inplace=True)

# assert that all names are unique
# and clean names
Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoWGSCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def set_filenames(row):
cols_to_print = ["chr_id", "bpstart", "bpend", "sgRNA", "Expected_HDR", "Coding_sequence", "sequence", "n_reads", "bam_file_with_reads_in_region", "fastq_file_trimmed_reads_in_region"]
if args.gene_annotations:
cols_to_print.append('gene_overlapping')
df_regions.fillna('NA').to_csv(report_reads_aligned_filename, sep='\t', columns = cols_to_print, index_label="Name")
df_regions.infer_objects(copy=False).fillna('NA').to_csv(report_reads_aligned_filename, sep='\t', columns = cols_to_print, index_label="Name")

#save progress
crispresso2_info['running_info']['finished_steps']['generation_of_fastq_files_for_each_amplicon'] = True
Expand Down

0 comments on commit 340a4e1

Please sign in to comment.