Skip to content

Commit e28f198

Browse files
committed
correcting some errors
1 parent f163394 commit e28f198

File tree

4 files changed

+11
-29
lines changed

4 files changed

+11
-29
lines changed

mitnanex_cli.sh

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ while getopts 'i:t:p:m:M:w:c:x:r:s:q:f:g:k:d' opt; do
7070
c)
7171
coverage=$OPTARG
7272
;;
73-
;;
7473
x)
7574
min_num_clusters=$OPTARG
7675
;;
@@ -149,20 +148,10 @@ subsample(){
149148
echo $timestamp': Step 1: Sampling with seqtk'
150149
echo " "
151150
seqkit seq -g --threads $threads --min-len $min_len --max-len $max_len $input_file | \
152-
seqtk sample $input_file $proportion > $wd$prefix"_sample.sorted.fastq"
151+
seqtk sample - $proportion > $wd$prefix"_sample.sorted.fastq"
153152
echo $timestamp": $(samtools view -c $wd$prefix"_sample.sorted.fastq") reads outputted"
154153
}
155154

156-
trim_adapters(){
157-
## $1 input
158-
## $2 output
159-
## TRIM ADAPTERS
160-
echo " "
161-
echo $timestamp': Trimming adapters with porechop'
162-
echo " "
163-
porechop --verbosity 0 -t $threads -i $1 -o $2
164-
}
165-
166155
sort_file(){
167156
## SORT FILE
168157
echo " "
@@ -178,7 +167,7 @@ reads_overlap(){
178167
echo " "
179168
echo $timestamp': Looking for overlaps with minimap2'
180169
echo " "
181-
minimap2 -x ava-ont -t $threads --dual=yes \
170+
minimap2 -x ava-ont -t $threads --dual=yes --split-prefix $prefix \
182171
$wd$prefix"_sample.sorted.fastq" $wd$prefix"_sample.sorted.fastq" | \
183172
fpa drop --internalmatch --length-lower $min_len > $wd$prefix".paf"
184173
}
@@ -294,21 +283,14 @@ start=$SECONDS
294283

295284
#### PIPELINE ####
296285

297-
### Trimming adapter with porechop. There in the order of how they were extracted.
298-
### It's slow, so I will comfort the dorado feature to remove adapters
299-
300-
##&& trim_adapters $wd$prefix"_sample.sorted.fastq" $wd$prefix"_sample.sorted.fastq" \
301-
##&& trim_adapters $wd$prefix"_collected_reads.fastq" $wd$prefix"_collected_reads.fastq" \
302-
##&& trim_adapters $wd$prefix"_collected_reads.fastq" $wd$prefix"_collected_reads.fastq" \
303-
304286
create_wd && subsample \
305-
&& sort_file && reads_overlap && mt_reads_filt && first_assembly && gfa2fasta \
287+
&& sort_file && reads_overlap && mt_reads_filt \
288+
&& first_assembly && gfa2fasta \
306289
&& collecting_mt_reads $wd$prefix"_first_draft_asm.fasta" $input_file $wd$prefix"_align.bam" $wd$prefix"_collected_reads.fastq" \
307290
&& quality_control && second_assembly && select_contig \
308291
&& collecting_mt_reads $wd$prefix"_second_draft_asm.fasta" $input_file $wd$prefix"_align.bam" $wd$prefix"_collected_reads.fastq" \
309-
&& quality_control && correct_reads #&& polish_asm
310-
311-
#correct_reads
292+
&& quality_control
293+
#&& correct_reads #&& polish_asm
312294

313295
echo ""
314296
echo "### MITNANEX finished ###"

src/select_contig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def select_contig(flye_metadata: str, flye_asm_file: str) -> str:
1212
flye_metadata_df = pd.read_csv(flye_metadata, delimiter="\t", header=0)
1313
print("")
1414
print("---> metadata of contigs generated by Flye <---")
15+
flye_metadata_df.sort_values(by=["cov.", "length"], inplace=True, ascending=False)
1516
print(flye_metadata_df)
16-
flye_metadata_df.sort_values(by=["cov.", "length"], inplace=True)
1717

1818
## Check if there is a circular genome. If so and there are more than one, select the longest
1919
if flye_metadata_df.empty:
@@ -24,7 +24,7 @@ def select_contig(flye_metadata: str, flye_asm_file: str) -> str:
2424
print("A circular genome found!!")
2525
flye_metadata_df = flye_metadata_df[
2626
flye_metadata_df["circ."] == "Y"
27-
].sort_values(by=["cov.", "length"])
27+
].sort_values(by=["cov.", "length"], ascending=False)
2828
return get_contig_sequence(flye_metadata_df["#seq_name"].iloc[0], flye_asm_file)
2929

3030
else:

src/utils_rs/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/target
2-
2+
._target
33
# Byte-compiled / optimized / DLL files
44
__pycache__/
55
.pytest_cache/
@@ -69,4 +69,4 @@ docs/_build/
6969
.vscode/
7070

7171
# Pyenv
72-
.python-version
72+
.python-version

src/utils_rs/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["maturin>=1.3,<2.0"]
33
build-backend = "maturin"
44

55
[project]
6-
name = "utils"
6+
name = "utils_mitnanex"
77
requires-python = ">=3.7"
88
classifiers = [
99
"Programming Language :: Rust",

0 commit comments

Comments
 (0)