Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kofman committed Feb 3, 2025
2 parents 8e182d8 + 5ee0824 commit e1894d0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Install Mamba
run: |
conda install -c conda-forge mamba=1.5.12 -y
conda install -c conda-forge mamba=1.5.12 -y
- name: Print conda folder contents
run: |
Expand Down
4 changes: 3 additions & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from multiprocessing import Pool
import multiprocessing
import time
import tracemalloc
import anndata as ad
import scanpy as sc
from scipy.sparse import csr_matrix
Expand Down Expand Up @@ -1460,7 +1461,8 @@ def get_edits_with_coverage_df(output_folder,
# this will still be true even with no barcode specified, in which case the contig will be <contig>_no_barcode

# Therefore: replace the contig with the part before the barcode
all_edit_info_unique_position_with_coverage_df['contig'] = all_edit_info_unique_position_with_coverage_df.apply(lambda row: row['contig'].replace('_{}'.format(row['barcode']), ''), axis=1)
if len(all_edit_info_unique_position_with_coverage_df) > 0:
all_edit_info_unique_position_with_coverage_df['contig'] = all_edit_info_unique_position_with_coverage_df.apply(lambda row: row['contig'].replace('_{}'.format(row['barcode']), ''), axis=1)

return all_edit_info_unique_position_with_coverage_df

Expand Down
7 changes: 6 additions & 1 deletion tests/integration_tests_auto_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@


test_name_to_expectations = {
"edge_case_test": {
"no_edits_edge_case_test": {
"folder": "strandedness_tests",
"total_edit_sites": 0,
"expectations": []
},
"edge_case_test": {
"folder": "singlecell_tests",
"total_edit_sites": 2,
"expectations": [{
Expand Down
11 changes: 7 additions & 4 deletions tests/integration_tests_run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status

mypython=$1

echo "Python is $mypython"
Expand All @@ -13,11 +16,11 @@ tests_folder="strandedness_tests/"
echo "Bulk tests scripts"
ls -lh $MARINE/tests/$tests_folder/scripts/

for t in "F1R2_pair_test-single_end_mode_sailor" "F1R2_pair_test-single_end_mode" "F1R2_pair_test" "F2R1_end_second_in_pair_test" "same_pos_dif_reads_test" "tax1bp3_chr17_3665556_read_test" "pair_test" "unstranded_pair_test"
for t in "no_edits_edge_case_test" "F1R2_pair_test-single_end_mode_sailor" "F1R2_pair_test-single_end_mode" "F1R2_pair_test" "F2R1_end_second_in_pair_test" "same_pos_dif_reads_test" "tax1bp3_chr17_3665556_read_test" "pair_test" "unstranded_pair_test"
do
echo $t
echo "Removing old files..."
rm $MARINE/tests/$tests_folder$t/* -r
rm $MARINE/tests/$tests_folder$t/* -r || true

echo "Running tests..."
bash $MARINE/tests/$tests_folder/scripts/$t.sh $mypython
Expand All @@ -39,7 +42,7 @@ for t in "only_5_cells_test" "only_5_cells_bulk_mode_test" "only_5_cells_all_cel
do
echo $t
echo "Removing old files..."
rm $MARINE/tests/$tests_folder$t/* -r
rm $MARINE/tests/$tests_folder$t/* -r || true

echo "Running tests..."
bash $MARINE/tests/$tests_folder/scripts/$t.sh $mypython
Expand All @@ -53,4 +56,4 @@ $mypython $MARINE/tests/integration_tests_auto_check.py tests
exitcode=$?

echo "Exit code: $exitcode"
exit $exitcode
exit $exitcode
20 changes: 20 additions & 0 deletions tests/strandedness_tests/scripts/no_edits_edge_case_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mypython=$1

$mypython $MARINE/marine.py \
--bam_filepath \
$MARINE/tests/strandedness_tests/bams/same_pos_dif_reads.bam \
--annotation_bedfile_path \
$MARINE/annotations/hg38_gencode.v35.annotation.genes.bed \
--output_folder \
$MARINE/tests/strandedness_tests/no_edits_edge_case_test \
--min_dist_from_end \
0 \
--min_base_quality \
50 \
--cores \
16 \
--paired_end \
--strandedness 2 \
--contigs "chr17" \
--num_intervals_per_contig 16 \
--keep_intermediate_files

0 comments on commit e1894d0

Please sign in to comment.