Mercurial > repos > greg > pima_report
comparison pima_report.py @ 6:b13d4c14caaa draft
Uploaded
author | greg |
---|---|
date | Thu, 09 Mar 2023 17:54:17 +0000 |
parents | 9cb62054a87a |
children | 9213359bfda8 |
comparison
equal
deleted
inserted
replaced
5:7177d81eb7cb | 6:b13d4c14caaa |
---|---|
419 def add_contamination(self): | 419 def add_contamination(self): |
420 self.ofh.write("\nXXXXXX In add_contamination\n\n") | 420 self.ofh.write("\nXXXXXX In add_contamination\n\n") |
421 if self.kraken2_report_file is None: | 421 if self.kraken2_report_file is None: |
422 return | 422 return |
423 # Read in the Kraken fractions and pull out the useful parts | 423 # Read in the Kraken fractions and pull out the useful parts |
424 self.kraken_fracs = pandas.read_csv(self.kraken_report_file, delimiter='\t', header=None) | 424 self.kraken_fracs = pandas.read_csv(self.kraken2_report_file, delimiter='\t', header=None) |
425 self.kraken_fracs.index = self.kraken_fracs.iloc[:, 4].values | 425 self.kraken_fracs.index = self.kraken_fracs.iloc[:, 4].values |
426 self.kraken_fracs = self.kraken_fracs.loc[self.kraken_fracs.iloc[:, 3].str.match('[UG]1?'), :] | 426 self.kraken_fracs = self.kraken_fracs.loc[self.kraken_fracs.iloc[:, 3].str.match('[UG]1?'), :] |
427 self.kraken_fracs = self.kraken_fracs.loc[(self.kraken_fracs.iloc[:, 0] >= 1) | (self.kraken_fracs.iloc[:, 3] == 'U'), :] | 427 self.kraken_fracs = self.kraken_fracs.loc[(self.kraken_fracs.iloc[:, 0] >= 1) | (self.kraken_fracs.iloc[:, 3] == 'U'), :] |
428 self.kraken_fracs = self.kraken_fracs.iloc[:, [0, 1, 3, 5]] | 428 self.kraken_fracs = self.kraken_fracs.iloc[:, [0, 1, 3, 5]] |
429 self.kraken_fracs.columns = ['Fraction', 'Reads', 'Level', 'Taxa'] | 429 self.kraken_fracs.columns = ['Fraction', 'Reads', 'Level', 'Taxa'] |