-
Notifications
You must be signed in to change notification settings - Fork 45
my proposed changes #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/cells_argument
Are you sure you want to change the base?
my proposed changes #185
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def parse_barcode_reference( | |
barcode_pattern = rf"^[ATGC]{{{barcode_length}}}" | ||
|
||
header = barcodes_pl.columns | ||
set_dif = set(required_header) - set(header) | ||
set_dif = set([required_header]) - set(header) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. without the brackets it was splitting every letter of the required_header There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep that one in, I'll merge once the PR is ready |
||
if len(set_dif) != 0: | ||
set_diff_string = ",".join(list(set_dif)) | ||
raise SystemExit(f"The header is missing {set_diff_string}. Exiting") | ||
|
@@ -74,7 +74,7 @@ def parse_barcode_reference( | |
|
||
else: | ||
barcodes_pl = barcodes_pl.with_columns( | ||
reference=pl.col(REFERENCE_COLUMN).str.strip_chars(STRIP_CHARS), | ||
reference=pl.col(required_header).str.strip_chars(STRIP_CHARS), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm changing the behavior here a little bit. I think I'm gonna use "reference" even in the whitelist input. Just makes the logic a bit cleaner |
||
) | ||
|
||
check_sequence_pattern( | ||
|
@@ -110,7 +110,7 @@ def parse_tags_csv(file_name: str) -> pl.DataFrame: | |
TTCCGCCTCTCTTTG,Hashtag_3 | ||
|
||
Args: | ||
file_name (str): file path as a tring | ||
file_name (str): file path as a string | ||
|
||
Returns: | ||
pl.DataFrame: polars dataframe with the csv content | ||
|
@@ -381,16 +381,17 @@ def get_barcode_subset( | |
enable_barcode_correction = True | ||
if barcode_whitelist: | ||
barcode_subset = parse_barcode_reference( | ||
filename=expected_barcodes, | ||
filename=barcode_whitelist, | ||
barcode_length=(chemistry.cell_barcode_end - chemistry.cell_barcode_start), | ||
required_header=WHITELIST_COLUMN, | ||
) | ||
n_barcodes = len(barcode_subset) # ??? | ||
else: | ||
n_barcodes = barcode_whitelist | ||
n_barcodes = expected_barcodes | ||
if barcode_reference is not None: | ||
barcode_subset = ( | ||
barcodes_df.filter( | ||
pl.col(BARCODE_COLUMN).str.is_in( | ||
pl.col(BARCODE_COLUMN).is_in( | ||
barcode_reference[REFERENCE_COLUMN] | ||
) | ||
) | ||
|
@@ -399,7 +400,7 @@ def get_barcode_subset( | |
.sort("count", descending=True) | ||
.head(n_barcodes * 1.2) | ||
.drop("count") | ||
.rename({SEQUENCE_COLUMN: WHITELIST_COLUMN}) | ||
.rename({BARCODE_COLUMN: WHITELIST_COLUMN}) | ||
) | ||
else: | ||
raw_barcodes_dict = ( | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sequence,feature_name | ||
CGTACGTAGCCTAGC,test1 | ||
CGTAGCTCGAAAAAA,test2 | ||
CGTCGAAGCTGAACG,test3 | ||
CGTCGTAGCTGATCG,test4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
whitelist | ||
TACATATTCTTTACTG | ||
TAGAGGGAAGTCAAGC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires python >= 3.10 to get the
| None
working.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is only for documentation updates, not the code itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaah. But then, which python is used? It was written
python3.6 setup.py install
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it on the branch to 3.11