Closed evanroyrees closed 2 years ago
nf-core lint
overall result: Passed :white_check_mark: :warning:Posted for pipeline commit 7d942e3
+| ✅ 62 tests passed |+
#| ❔ 34 tests were ignored |#
!| ❗ 9 tests had warnings |!
Merging #254 (7d942e3) into dev (025b099) will decrease coverage by
0.01%
. The diff coverage is0.00%
.
@@ Coverage Diff @@
## dev #254 +/- ##
==========================================
- Coverage 27.30% 27.28% -0.02%
==========================================
Files 45 45
Lines 5336 5339 +3
==========================================
Hits 1457 1457
- Misses 3879 3882 +3
Flag | Coverage Δ | |
---|---|---|
unittests | 27.28% <0.00%> (-0.02%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
autometa/validation/benchmark.py | 0.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 5442af2...7d942e3. Read the comment docs.
May be cleaner: 'pred_df.taxid = pred_df.taxid.clip(lower=1)'
could also be done inplace
May be cleaner:
pred_df.taxid = pred_df.taxid.clip(lower=1)
could also be done inplace
Nice, I was unaware of this method.
I'm not sure if this is preferred or more understandable 🤷
Or if inplace
modification vs. reassignment is preferred.
pred_df.taxid.clip(lower=1, inplace=True)
feels nice and clean though 😄
Both ways look good to me. You can chose and I can approve it.
The only concern I have is whether this will work if any of the taxids are strings rather than a float
or int
?
The only concern I have is whether this will work if any of the taxids are strings rather than a
float
orint
?
it would error
Ah, yeah.
df.taxid.clip(lower=1)
TypeError: '>=' not supported between instances of 'str' and 'int'
The current mapping method will leave any 'str' types to be converted with ncbi.convert_taxid_dtype(...)
@Sidduppal, then I think this is ready for review. Albeit maybe not as clean, it leaves the exceptions for ncbi.convert_taxid_dtype
:art::snake: Some taxon-profilers assign unclassified contigs to a taxid of 0 where others assign root taxid of 1.
The NCBI class method of converting the taxid datatype expects a positive integer, so we are converting the unclassified taxid of 0 to the root taxid of 1. All input predictions will be converted in this same way. The contigs with their converted taxids as well as the number of 'unclassified' taxids are now emitted in the logs during conversion.