Skip to content

Castanet failing when -PostFilt True #40

@AnnieJForster

Description

@AnnieJForster

Hi Rich,

Fyi, I work with Michael and Tanya.

I have run into a few bugs in 9.2 when filtering contaminated reads ("-PostFilt True").

  1. I think Michael has raised this but "-PostFilt" was not available on the command line.
  2. The dictionary filtering in lines 127 and 133 in app/src/parse_bam.py I think cancel each other out producing an empty read list, and then an empty bam.
 dat = {k: v for k, v in dat.items() if len(v) > ## here
              self.minimum_n_filter}

  with open(self.fnames["delreads"], "w") as f:
      [f.write(f"{v[0][1]}\n") for v in dat.values()
       if len(v) <= self.minimum_n_filter] ## and here 

The samtools command filters to keep all reads in the read list, so I believe removing the final if statement above solves this.

  1. Once the above is bypassed, castanet seems to stop. I think this is because of the error handling in line 136 in the same script as the samtools command does not produce the expected healthy_msg.
  out = shell(
      f"samtools view -@ {self.p['NThreads']} -b -N {self.fnames['delreads']} {self.fnames['bam']} > {self.fnames['bamfilt']}", is_test=True)
  error_handler_cli(out, self.fnames['bamfilt'], "samtools") ## run stops here

Everything ran once I'd adjusted for the above. Let me know if you need any more info.

Many thanks,

Annie

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions