Skip to content

Commit

Permalink
I need to filt better the result of miniasm
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjo255 committed Dec 11, 2023
1 parent bd71fac commit d14936b
Show file tree
Hide file tree
Showing 31 changed files with 16 additions and 7 deletions.
Binary file modified .DS_Store
100644 → 100755
Binary file not shown.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified environment_mac.yml
100644 → 100755
Empty file.
Empty file modified environment_mac_x86.yml
100644 → 100755
Empty file.
Empty file modified images/MITNANEX.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 16 additions & 7 deletions mitnanex_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ map_identity=0.6
min_qual=-1
wd="./"
flye_mode='--nano-hq'
genomeCoverage=50
keepPercent=80
output_dir='mitnanex_results/'

## Help message
Expand Down Expand Up @@ -37,13 +39,15 @@ mitnanex_help() {
-s Mapping identity. Minimun identity between two reads to be store in the same cluster.[0.6].
-q Min mapping quality (>=). This is for samtools. [-1].
-f Flye mode. [--nano-hq]
-g GenomeSize. This is your best estimation of the mitogenome for read correction with Canu. [required].
-g GenomeSize. This is your best estimation of the mitogenome for read correction with Canu and for flye. [required].
-e GenomeCoverage. This is for flye, limit the coverage for initial disjointig assembly. [50].
-k keepPercent. Percentage of reads to keep during filter with filtlong. [80].
* Help.
"
exit 1
}

while getopts 'i:t:p:m:M:w:c:r:s:q:f:g:d' opt; do
while getopts 'i:t:p:m:M:w:c:r:s:q:f:g:e:k:d' opt; do
case $opt in
i)
input_file=$OPTARG
Expand Down Expand Up @@ -81,6 +85,12 @@ while getopts 'i:t:p:m:M:w:c:r:s:q:f:g:d' opt; do
g)
genomeSize=$OPTARG
;;
e)
genomeCoverage=$OPTARG
;;
k)
keepPercent=$OPTARG
;;
d)
output_dir="mitnanex_results_$(date "+%Y-%m-%d_%H-%M-%S")/"
;;
Expand Down Expand Up @@ -135,7 +145,7 @@ create_wd(){
subsample(){
## SUBSAMPLE
echo " "
echo $timestamp': Step 1: Sampling with seqkit'
echo $timestamp': Step 1: Sampling with seqtk'
echo " "
seqkit seq -g --threads $threads --min-len $min_len --max-len $max_len $input_file | \
seqtk sample $input_file $proportion > $wd$prefix"_sample.sorted.fastq"
Expand Down Expand Up @@ -187,7 +197,7 @@ first_assembly(){
echo " "
minimap2 -x ava-ont -t $threads --dual=yes \
$wd$prefix"_putative_mt_reads.fasta" $wd$prefix"_putative_mt_reads.fasta" | \
miniasm -S6 -f $wd$prefix"_putative_mt_reads.fasta" - > $wd$prefix"_first_draft_asm.gfa"
miniasm -S7 -f $wd$prefix"_putative_mt_reads.fasta" - > $wd$prefix"_first_draft_asm.gfa"
}

gfa2fasta(){
Expand Down Expand Up @@ -224,7 +234,7 @@ collecting_mt_reads(){
second_assembly(){
## ASSEMBLE WITH FLYE
echo $timestamp': Generating a draft assembly with Flye'
flye -t $threads --meta \
flye -t $threads --meta --no-alt-contigs --asm-coverage $genomeCoverage --genome-size $genomeSize \
$flye_mode $wd$prefix"_collected_reads.filtlong.fastq" -o $wd$prefix"_flye_asm/"
}

Expand Down Expand Up @@ -259,7 +269,7 @@ quality_control(){
## QUALITY CONTROL USING FILTLONG
echo ""
echo $timestamp': Tossing up bad reads with filtlong'
filtlong --min_length $min_len --keep_percent 90 $wd$prefix"_collected_reads.fastq" > $wd$prefix"_collected_reads.filtlong.fastq"
filtlong --min_length $min_len --keep_percent $keepPercent $wd$prefix"_collected_reads.fastq" > $wd$prefix"_collected_reads.filtlong.fastq"
}

### VISAJE INICIAL ###
Expand Down Expand Up @@ -290,7 +300,6 @@ create_wd && subsample && trim_adapters $wd$prefix"_sample.sorted.fastq" $wd$pre
&& trim_adapters $wd$prefix"_collected_reads.fastq" $wd$prefix"_collected_reads.fastq" \
&& quality_control && correct_reads && polish_asm


echo ""
echo "### MITNANEX finished ###"
echo ""
Expand Down
Empty file modified requirements_macOS.txt
100644 → 100755
Empty file.
Empty file modified setup.sh
100644 → 100755
Empty file.
Empty file modified src/__init__.py
100644 → 100755
Empty file.
Empty file modified src/assign_cluster.py
100644 → 100755
Empty file.
Empty file modified src/cluster.py
100644 → 100755
Empty file.
Empty file modified src/cluster_kmer_profiles.py
100644 → 100755
Empty file.
Empty file modified src/hash_function.py
100644 → 100755
Empty file.
Empty file modified src/kmer_cnt.py
100644 → 100755
Empty file.
Empty file modified src/kmer_reduction_PCA.py
100644 → 100755
Empty file.
Empty file modified src/minimun_cov.py
100644 → 100755
Empty file.
Empty file modified src/mitnanex.py
100644 → 100755
Empty file.
Empty file modified src/psa.py
100644 → 100755
Empty file.
Empty file modified src/select_contig.py
100644 → 100755
Empty file.
Empty file modified src/tests.py
100644 → 100755
Empty file.
Empty file modified src/utils.py
100644 → 100755
Empty file.
Empty file modified src/utils_rs/.github/workflows/CI.yml
100644 → 100755
Empty file.
Empty file modified src/utils_rs/.gitignore
100644 → 100755
Empty file.
Empty file modified src/utils_rs/Cargo.lock
100644 → 100755
Empty file.
Empty file modified src/utils_rs/Cargo.toml
100644 → 100755
Empty file.
Empty file modified src/utils_rs/pyproject.toml
100644 → 100755
Empty file.
Empty file modified src/utils_rs/src/lib.rs
100644 → 100755
Empty file.
Binary file modified test/.DS_Store
100644 → 100755
Binary file not shown.
Empty file modified test/reads_retrieval.py
100644 → 100755
Empty file.
Empty file modified test/track_mitnanex_output.py
100644 → 100755
Empty file.

0 comments on commit d14936b

Please sign in to comment.