App-Anchr
view release on metacpan or search on metacpan
doc/bacteria_2_3.md view on Meta::CPAN
```
| Name | SumFq | CovFq | AvgRead | Kmer | SumFa | Discard% | RealG | EstG | Est/Real | SumKU | SumSR | RunTime |
|:-------|--------:|------:|--------:|-------------------:|--------:|---------:|------:|------:|---------:|------:|------:|----------:|
| Q20L60 | 333.65M | 72.4 | 148 | "41,61,81,101,121" | 307.96M | 7.702% | 4.61M | 4.22M | 0.92 | 4.26M | 0 | 0:04'30'' |
| Q20L90 | 330.19M | 71.7 | 149 | "41,61,81,101,121" | 305.44M | 7.493% | 4.61M | 4.21M | 0.91 | 4.26M | 0 | 0:04'36'' |
| Q25L60 | 318.5M | 69.1 | 148 | "41,61,81,101,121" | 301.45M | 5.353% | 4.61M | 4.19M | 0.91 | 4.22M | 0 | 0:04'29'' |
| Q25L90 | 313.06M | 67.9 | 149 | "41,61,81,101,121" | 296.68M | 5.230% | 4.61M | 4.19M | 0.91 | 4.22M | 0 | 0:05'02'' |
| Q30L60 | 299.31M | 65.0 | 147 | "41,61,81,101,121" | 287.19M | 4.047% | 4.61M | 4.18M | 0.91 | 4.22M | 0 | 0:04'58'' |
| Q30L90 | 292.25M | 63.4 | 148 | "41,61,81,101,121" | 280.53M | 4.009% | 4.61M | 4.18M | 0.91 | 4.22M | 0 | 0:04'49'' |
| Name | N50SR | Sum | # | N50Anchor | Sum | # | N50Others | Sum | # | RunTime |
|:-------|------:|------:|----:|----------:|------:|----:|----------:|-------:|----:|----------:|
| Q20L60 | 8637 | 4.26M | 778 | 8821 | 4.17M | 660 | 765 | 87.11K | 118 | 0:00'51'' |
| Q20L90 | 9406 | 4.26M | 725 | 9482 | 4.18M | 615 | 766 | 80.73K | 110 | 0:00'53'' |
| Q25L60 | 19847 | 4.22M | 398 | 20462 | 4.18M | 337 | 770 | 44.81K | 61 | 0:00'58'' |
| Q25L90 | 21495 | 4.22M | 378 | 21517 | 4.18M | 321 | 765 | 41.64K | 57 | 0:00'56'' |
| Q30L60 | 29285 | 4.22M | 316 | 29285 | 4.18M | 264 | 760 | 37.42K | 52 | 0:00'57'' |
| Q30L90 | 29285 | 4.22M | 314 | 29570 | 4.18M | 261 | 760 | 37.88K | 53 | 0:00'56'' |
## Sfle: merge anchors
```bash
BASE_DIR=$HOME/data/anchr/Sfle
cd ${BASE_DIR}
# merge anchors
mkdir -p merge
anchr contained \
Q20L60/anchor/pe.anchor.fa \
Q20L90/anchor/pe.anchor.fa \
Q25L60/anchor/pe.anchor.fa \
Q25L90/anchor/pe.anchor.fa \
Q30L60/anchor/pe.anchor.fa \
Q30L90/anchor/pe.anchor.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
anchr contained \
Q20L60/anchor/pe.others.fa \
Q20L90/anchor/pe.others.fa \
Q25L60/anchor/pe.others.fa \
Q25L90/anchor/pe.others.fa \
Q30L60/anchor/pe.others.fa \
Q30L90/anchor/pe.others.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# sort on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
## Sfle: 3GS
```bash
BASE_DIR=$HOME/data/anchr/Sfle
cd ${BASE_DIR}
canu \
-p Sfle -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=4.8m \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p Sfle -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=4.8m \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/Sfle.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/Sfle.trimmedReads.fasta.gz
```
## Sfle: expand anchors
* anchorLong
```bash
BASE_DIR=$HOME/data/anchr/Sfle
cd ${BASE_DIR}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/Sfle.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/Sfle.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
anchr overlap \
merge/anchor.cover.fasta \
--serial --len 10 --idt 0.9999 \
-o stdout \
| perl -nla -e '
BEGIN {
our %seen;
our %count_of;
}
@F == 13 or next;
$F[3] > 0.9999 or next;
my $pair = join( "-", sort { $a <=> $b } ( $F[0], $F[1], ) );
next if $seen{$pair};
$seen{$pair} = $_;
$count_of{ $F[0] }++;
$count_of{ $F[1] }++;
END {
for my $pair ( keys %seen ) {
my ($f_id, $g_id) = split "-", $pair;
next if $count_of{$f_id} > 2;
next if $count_of{$g_id} > 2;
print $seen{$pair};
}
}
' \
| sort -k 1n,1n -k 2n,2n \
> anchorLong/anchor.ovlp.tsv
ANCHOR_COUNT=$(faops n50 -H -N 0 -C anchorLong/anchor.fasta)
echo ${ANCHOR_COUNT}
rm -fr anchorLong/group
anchr group \
anchorLong/anchorLong.db \
anchorLong/anchorLong.ovlp.tsv \
--oa anchorLong/anchor.ovlp.tsv \
--parallel 16 \
--range "1-${ANCHOR_COUNT}" --len 1000 --idt 0.98 --max "-14" -c 4 --png
pushd ${BASE_DIR}/anchorLong
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr overlap --len 10 --idt 0.9999 \
group/{}.strand.fasta \
-o stdout \
| perl -nla -e '\''
@F == 13 or next;
$F[3] > 0.98 or next;
$F[9] == 0 or next;
$F[5] > 0 and $F[6] == $F[7] or next;
/anchor.+anchor/ or next;
print;
'\'' \
> group/{}.anchor.ovlp.tsv
anchr layout \
group/{}.ovlp.tsv \
group/{}.relation.tsv \
group/{}.strand.fasta \
--oa group/{}.anchor.ovlp.tsv \
--png \
-o group/{}.contig.fasta
'
popd
# false strand
cat anchorLong/group/*.ovlp.tsv \
| perl -nla -e '/anchor.+long/ or next; print $F[0] if $F[8] == 1;' \
| sort | uniq -c
cat \
anchorLong/group/non_grouped.fasta\
anchorLong/group/*.contig.fasta \
| faops filter -l 0 -a 1000 stdin anchorLong/contig.fasta
```
* contigTrim
```bash
BASE_DIR=$HOME/data/anchr/Sfle
cd ${BASE_DIR}
rm -fr contigTrim
anchr overlap2 \
--parallel 16 \
anchorLong/contig.fasta \
canu-raw-40x/Sfle.contigs.fasta \
-d contigTrim \
-b 20 --len 1000 --idt 0.98 --all
CONTIG_COUNT=$(faops n50 -H -N 0 -C contigTrim/anchor.fasta)
echo ${CONTIG_COUNT}
rm -fr contigTrim/group
anchr group \
--parallel 16 \
--keep \
contigTrim/anchorLong.db \
contigTrim/anchorLong.ovlp.tsv \
--range "1-${CONTIG_COUNT}" --len 1000 --idt 0.98 --max 20000 -c 1
pushd ${BASE_DIR}/contigTrim
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr layout \
doc/bacteria_2_3.md view on Meta::CPAN
|:---------------|-------:|------:|----:|----------:|------:|----:|----------:|-------:|---:|----------:|
| Q20L60_1000000 | 105824 | 5.06M | 127 | 105824 | 5.04M | 99 | 697 | 18.92K | 28 | 0:00'58'' |
| Q20L60_2000000 | 79132 | 5.06M | 150 | 82106 | 5.04M | 125 | 710 | 17.57K | 25 | 0:01'27'' |
| Q20L60_3000000 | 45783 | 5.06M | 223 | 45783 | 5.04M | 194 | 710 | 20.35K | 29 | 0:01'55'' |
| Q20L60_4000000 | 32504 | 5.07M | 301 | 33092 | 5.04M | 271 | 710 | 20.92K | 30 | 0:02'14'' |
| Q20L60_5000000 | 24540 | 5.08M | 401 | 24540 | 5.05M | 362 | 745 | 27.59K | 39 | 0:02'37'' |
| Q25L60_1000000 | 153473 | 5.06M | 107 | 153473 | 5.04M | 78 | 722 | 20.76K | 29 | 0:00'53'' |
| Q25L60_2000000 | 155751 | 5.06M | 105 | 155751 | 5.04M | 81 | 745 | 16.97K | 24 | 0:01'22'' |
| Q25L60_3000000 | 88545 | 5.05M | 126 | 88545 | 5.04M | 101 | 710 | 17.51K | 25 | 0:01'47'' |
| Q25L60_4000000 | 71321 | 5.06M | 161 | 71321 | 5.04M | 135 | 745 | 18.37K | 26 | 0:02'14'' |
| Q25L60_5000000 | 55803 | 5.07M | 196 | 55803 | 5.05M | 169 | 729 | 19.05K | 27 | 0:02'39'' |
| Q30L60_1000000 | 179300 | 5.05M | 110 | 179300 | 5.04M | 82 | 656 | 18.77K | 28 | 0:00'53'' |
| Q30L60_2000000 | 175008 | 5.06M | 100 | 175008 | 5.04M | 77 | 710 | 16.14K | 23 | 0:01'22'' |
| Q30L60_3000000 | 155751 | 5.06M | 106 | 155751 | 5.04M | 82 | 693 | 16.62K | 24 | 0:01'46'' |
| Q30L60_4000000 | 123854 | 5.05M | 107 | 123854 | 5.04M | 84 | 710 | 16.14K | 23 | 0:02'14'' |
| Q30L60_5000000 | 99637 | 5.05M | 123 | 99637 | 5.04M | 99 | 697 | 16.64K | 24 | 0:02'38'' |
## Vpar: merge anchors
```bash
BASE_DIR=$HOME/data/anchr/Vpar
cd ${BASE_DIR}
# merge anchors
mkdir -p merge
anchr contained \
Q20L60_2000000/anchor/pe.anchor.fa \
Q20L60_3000000/anchor/pe.anchor.fa \
Q20L60_4000000/anchor/pe.anchor.fa \
Q20L60_5000000/anchor/pe.anchor.fa \
Q25L60_2000000/anchor/pe.anchor.fa \
Q25L60_3000000/anchor/pe.anchor.fa \
Q25L60_4000000/anchor/pe.anchor.fa \
Q25L60_5000000/anchor/pe.anchor.fa \
Q30L60_2000000/anchor/pe.anchor.fa \
Q30L60_3000000/anchor/pe.anchor.fa \
Q30L60_4000000/anchor/pe.anchor.fa \
Q30L60_5000000/anchor/pe.anchor.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
anchr contained \
Q20L60_2000000/anchor/pe.others.fa \
Q25L60_2000000/anchor/pe.others.fa \
Q30L60_2000000/anchor/pe.others.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# sort on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
1_genome/paralogs.fas \
--label "merge,paralogs" \
-o 9_qa
```
## Vpar: 3GS
```bash
BASE_DIR=$HOME/data/anchr/Vpar
cd ${BASE_DIR}
canu \
-p Vpar -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=5.2m \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p Vpar -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=5.2m \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/Vpar.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/Vpar.trimmedReads.fasta.gz
```
## Vpar: expand anchors
* anchorLong
```bash
BASE_DIR=$HOME/data/anchr/Vpar
cd ${BASE_DIR}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/Vpar.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/Vpar.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
anchr overlap \
merge/anchor.cover.fasta \
--serial --len 10 --idt 0.9999 \
-o stdout \
| perl -nla -e '
BEGIN {
our %seen;
our %count_of;
}
@F == 13 or next;
$F[3] > 0.9999 or next;
my $pair = join( "-", sort { $a <=> $b } ( $F[0], $F[1], ) );
next if $seen{$pair};
$seen{$pair} = $_;
$count_of{ $F[0] }++;
$count_of{ $F[1] }++;
END {
for my $pair ( keys %seen ) {
my ($f_id, $g_id) = split "-", $pair;
next if $count_of{$f_id} > 2;
next if $count_of{$g_id} > 2;
print $seen{$pair};
}
}
' \
| sort -k 1n,1n -k 2n,2n \
> anchorLong/anchor.ovlp.tsv
ANCHOR_COUNT=$(faops n50 -H -N 0 -C anchorLong/anchor.fasta)
echo ${ANCHOR_COUNT}
rm -fr anchorLong/group
anchr group \
anchorLong/anchorLong.db \
anchorLong/anchorLong.ovlp.tsv \
--oa anchorLong/anchor.ovlp.tsv \
--parallel 16 \
--range "1-${ANCHOR_COUNT}" --len 1000 --idt 0.98 --max "-14" -c 4 --png
pushd ${BASE_DIR}/anchorLong
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr overlap --len 10 --idt 0.9999 \
group/{}.strand.fasta \
-o stdout \
| perl -nla -e '\''
@F == 13 or next;
$F[3] > 0.98 or next;
$F[9] == 0 or next;
$F[5] > 0 and $F[6] == $F[7] or next;
/anchor.+anchor/ or next;
print;
'\'' \
> group/{}.anchor.ovlp.tsv
anchr layout \
group/{}.ovlp.tsv \
group/{}.relation.tsv \
group/{}.strand.fasta \
--oa group/{}.anchor.ovlp.tsv \
--png \
-o group/{}.contig.fasta
'
popd
# false strand
cat anchorLong/group/*.ovlp.tsv \
| perl -nla -e '/anchor.+long/ or next; print $F[0] if $F[8] == 1;' \
| sort | uniq -c
cat \
anchorLong/group/non_grouped.fasta\
anchorLong/group/*.contig.fasta \
| faops filter -l 0 -a 1000 stdin anchorLong/contig.fasta
```
* contigTrim
```bash
BASE_DIR=$HOME/data/anchr/Vpar
cd ${BASE_DIR}
rm -fr contigTrim
anchr overlap2 \
--parallel 16 \
anchorLong/contig.fasta \
canu-raw-40x/Vpar.contigs.fasta \
-d contigTrim \
-b 20 --len 1000 --idt 0.98 --all
CONTIG_COUNT=$(faops n50 -H -N 0 -C contigTrim/anchor.fasta)
echo ${CONTIG_COUNT}
rm -fr contigTrim/group
anchr group \
--parallel 16 \
--keep \
contigTrim/anchorLong.db \
contigTrim/anchorLong.ovlp.tsv \
--range "1-${CONTIG_COUNT}" --len 1000 --idt 0.98 --max 20000 -c 1
pushd ${BASE_DIR}/contigTrim
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr layout \
doc/bacteria_2_3.md view on Meta::CPAN
| Q30L60_4000000 | 774.12M | 227.8 | 97 | "41,61,81" | 726.3M | 6.177% | 3.4M | 3.41M | 1.00 | 3.42M | 0 | 0:08'35'' |
| Name | N50SR | Sum | # | N50Anchor | Sum | # | N50Others | Sum | # | RunTime |
|:---------------|-------:|------:|----:|----------:|------:|----:|----------:|--------:|----:|----------:|
| Q20L60_1000000 | 59861 | 3.42M | 134 | 60611 | 3.36M | 110 | 43054 | 59.5K | 24 | 0:02'01'' |
| Q20L60_2000000 | 27709 | 3.43M | 222 | 28368 | 3.37M | 190 | 21578 | 65.35K | 32 | 0:03'10'' |
| Q20L60_3000000 | 14498 | 3.43M | 396 | 14852 | 3.38M | 353 | 955 | 55.98K | 43 | 0:04'01'' |
| Q20L60_4000000 | 7243 | 3.43M | 772 | 7331 | 3.34M | 648 | 749 | 90.87K | 124 | 0:04'34'' |
| Q25L60_1000000 | 120520 | 3.48M | 101 | 120520 | 3.37M | 66 | 88397 | 117.88K | 35 | 0:01'53'' |
| Q25L60_2000000 | 62424 | 3.43M | 124 | 62424 | 3.36M | 95 | 43054 | 62.52K | 29 | 0:03'02'' |
| Q25L60_3000000 | 30976 | 3.42M | 200 | 31319 | 3.39M | 175 | 897 | 32.64K | 25 | 0:03'32'' |
| Q25L60_4000000 | 20322 | 3.43M | 304 | 20440 | 3.38M | 273 | 14979 | 50.13K | 31 | 0:04'18'' |
| Q30L60_1000000 | 219482 | 3.41M | 83 | 219482 | 3.4M | 56 | 734 | 18.18K | 27 | 0:01'41'' |
| Q30L60_2000000 | 128845 | 3.42M | 93 | 128845 | 3.36M | 68 | 21578 | 59.28K | 25 | 0:02'42'' |
| Q30L60_3000000 | 68045 | 3.42M | 123 | 68045 | 3.37M | 97 | 15040 | 46.9K | 26 | 0:03'30'' |
| Q30L60_4000000 | 49793 | 3.42M | 146 | 49793 | 3.38M | 126 | 15040 | 42.66K | 20 | 0:03'54'' |
## Lpne: merge anchors
```bash
BASE_DIR=$HOME/data/anchr/Lpne
cd ${BASE_DIR}
# merge anchors
mkdir -p merge
anchr contained \
Q20L60_1000000/anchor/pe.anchor.fa \
Q20L60_2000000/anchor/pe.anchor.fa \
Q20L60_3000000/anchor/pe.anchor.fa \
Q20L60_4000000/anchor/pe.anchor.fa \
Q25L60_1000000/anchor/pe.anchor.fa \
Q25L60_2000000/anchor/pe.anchor.fa \
Q25L60_3000000/anchor/pe.anchor.fa \
Q25L60_4000000/anchor/pe.anchor.fa \
Q30L60_1000000/anchor/pe.anchor.fa \
Q30L60_2000000/anchor/pe.anchor.fa \
Q30L60_3000000/anchor/pe.anchor.fa \
Q30L60_4000000/anchor/pe.anchor.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
anchr contained \
Q20L60_2000000/anchor/pe.others.fa \
Q25L60_2000000/anchor/pe.others.fa \
Q30L60_2000000/anchor/pe.others.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# sort on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
## Lpne: 3GS
```bash
BASE_DIR=$HOME/data/anchr/Lpne
cd ${BASE_DIR}
canu \
-p Lpne -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=3.4m \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p Lpne -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=3.4m \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/Lpne.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/Lpne.trimmedReads.fasta.gz
```
## Lpne: expand anchors
* anchorLong
```bash
BASE_DIR=$HOME/data/anchr/Lpne
cd ${BASE_DIR}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/Lpne.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/Lpne.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
anchr overlap \
merge/anchor.cover.fasta \
--serial --len 10 --idt 0.9999 \
-o stdout \
| perl -nla -e '
BEGIN {
our %seen;
our %count_of;
}
@F == 13 or next;
$F[3] > 0.9999 or next;
my $pair = join( "-", sort { $a <=> $b } ( $F[0], $F[1], ) );
next if $seen{$pair};
$seen{$pair} = $_;
$count_of{ $F[0] }++;
$count_of{ $F[1] }++;
END {
for my $pair ( keys %seen ) {
my ($f_id, $g_id) = split "-", $pair;
next if $count_of{$f_id} > 2;
next if $count_of{$g_id} > 2;
print $seen{$pair};
}
}
' \
| sort -k 1n,1n -k 2n,2n \
> anchorLong/anchor.ovlp.tsv
ANCHOR_COUNT=$(faops n50 -H -N 0 -C anchorLong/anchor.fasta)
echo ${ANCHOR_COUNT}
rm -fr anchorLong/group
anchr group \
anchorLong/anchorLong.db \
anchorLong/anchorLong.ovlp.tsv \
--oa anchorLong/anchor.ovlp.tsv \
--parallel 16 \
--range "1-${ANCHOR_COUNT}" --len 1000 --idt 0.98 --max "-14" -c 4 --png
pushd ${BASE_DIR}/anchorLong
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr overlap --len 10 --idt 0.9999 \
group/{}.strand.fasta \
-o stdout \
| perl -nla -e '\''
@F == 13 or next;
$F[3] > 0.98 or next;
$F[9] == 0 or next;
$F[5] > 0 and $F[6] == $F[7] or next;
/anchor.+anchor/ or next;
print;
'\'' \
> group/{}.anchor.ovlp.tsv
anchr layout \
group/{}.ovlp.tsv \
group/{}.relation.tsv \
group/{}.strand.fasta \
--oa group/{}.anchor.ovlp.tsv \
--png \
-o group/{}.contig.fasta
'
popd
# false strand
cat anchorLong/group/*.ovlp.tsv \
| perl -nla -e '/anchor.+long/ or next; print $F[0] if $F[8] == 1;' \
| sort | uniq -c
cat \
anchorLong/group/non_grouped.fasta\
anchorLong/group/*.contig.fasta \
| faops filter -l 0 -a 1000 stdin anchorLong/contig.fasta
```
* contigTrim
```bash
BASE_DIR=$HOME/data/anchr/Lpne
cd ${BASE_DIR}
rm -fr contigTrim
anchr overlap2 \
--parallel 16 \
anchorLong/contig.fasta \
canu-raw-40x/Lpne.contigs.fasta \
-d contigTrim \
-b 20 --len 1000 --idt 0.98 --all
CONTIG_COUNT=$(faops n50 -H -N 0 -C contigTrim/anchor.fasta)
echo ${CONTIG_COUNT}
rm -fr contigTrim/group
anchr group \
--parallel 16 \
--keep \
contigTrim/anchorLong.db \
contigTrim/anchorLong.ovlp.tsv \
--range "1-${CONTIG_COUNT}" --len 1000 --idt 0.98 --max 20000 -c 1
pushd ${BASE_DIR}/contigTrim
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr layout \
doc/bacteria_2_3.md view on Meta::CPAN
| Q30L60_3000000 | 567.03M | 263.3 | 94 | "41,61,81" | 531.94M | 6.189% | 2.15M | 2.06M | 0.96 | 2.04M | 0 | 0:11'21'' |
| Q30L60_4000000 | 734.81M | 341.1 | 93 | "41,61,81" | 689.49M | 6.167% | 2.15M | 2.08M | 0.96 | 2.03M | 0 | 0:11'17'' |
| Name | N50SR | Sum | # | N50Anchor | Sum | # | N50Others | Sum | # | RunTime |
|:---------------|------:|------:|-----:|----------:|--------:|----:|----------:|--------:|-----:|----------:|
| Q20L60_1000000 | 7552 | 2.05M | 478 | 7717 | 1.97M | 379 | 725 | 74.35K | 99 | 0:01'52'' |
| Q20L60_2000000 | 3187 | 2.03M | 890 | 3441 | 1.86M | 654 | 757 | 172.56K | 236 | 0:02'15'' |
| Q20L60_3000000 | 1304 | 1.84M | 1576 | 1728 | 1.21M | 708 | 746 | 623.36K | 868 | 0:02'51'' |
| Q20L60_4000000 | 977 | 1.6M | 1715 | 1435 | 767.32K | 531 | 724 | 833.17K | 1184 | 0:02'54'' |
| Q25L60_1000000 | 18201 | 2.04M | 222 | 18384 | 2.01M | 184 | 752 | 29.52K | 38 | 0:01'42'' |
| Q25L60_2000000 | 10804 | 2.04M | 345 | 10996 | 2M | 293 | 727 | 37.77K | 52 | 0:02'32'' |
| Q25L60_3000000 | 3585 | 2.03M | 824 | 3879 | 1.88M | 611 | 765 | 155.13K | 213 | 0:02'58'' |
| Q25L60_4000000 | 2270 | 2M | 1139 | 2532 | 1.72M | 757 | 786 | 283.29K | 382 | 0:03'38'' |
| Q30L60_1000000 | 20872 | 2.04M | 205 | 20872 | 2.01M | 165 | 721 | 28.47K | 40 | 0:01'57'' |
| Q30L60_2000000 | 20188 | 2.04M | 219 | 20628 | 2.01M | 178 | 762 | 31.84K | 41 | 0:02'36'' |
| Q30L60_3000000 | 16937 | 2.04M | 242 | 17918 | 2.01M | 201 | 726 | 29.25K | 41 | 0:03'19'' |
| Q30L60_4000000 | 14239 | 2.03M | 279 | 14269 | 2M | 228 | 752 | 37.14K | 51 | 0:03'35'' |
## Ngon: merge anchors
```bash
BASE_DIR=$HOME/data/anchr/Ngon
cd ${BASE_DIR}
# merge anchors
mkdir -p merge
anchr contained \
Q20L60_1000000/anchor/pe.anchor.fa \
Q20L60_2000000/anchor/pe.anchor.fa \
Q20L60_3000000/anchor/pe.anchor.fa \
Q25L60_1000000/anchor/pe.anchor.fa \
Q25L60_2000000/anchor/pe.anchor.fa \
Q25L60_3000000/anchor/pe.anchor.fa \
Q25L60_4000000/anchor/pe.anchor.fa \
Q30L60_1000000/anchor/pe.anchor.fa \
Q30L60_2000000/anchor/pe.anchor.fa \
Q30L60_3000000/anchor/pe.anchor.fa \
Q30L60_4000000/anchor/pe.anchor.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
anchr contained \
Q20L60_2000000/anchor/pe.others.fa \
Q25L60_2000000/anchor/pe.others.fa \
Q30L60_2000000/anchor/pe.others.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# sort on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
## Ngon: 3GS
```bash
BASE_DIR=$HOME/data/anchr/Ngon
cd ${BASE_DIR}
canu \
-p Ngon -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=2.3m \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p Ngon -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=2.3m \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/Ngon.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/Ngon.trimmedReads.fasta.gz
```
## Ngon: expand anchors
* anchorLong
```bash
BASE_DIR=$HOME/data/anchr/Ngon
cd ${BASE_DIR}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/Ngon.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/Ngon.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
anchr overlap \
merge/anchor.cover.fasta \
--serial --len 10 --idt 0.9999 \
-o stdout \
| perl -nla -e '
BEGIN {
our %seen;
our %count_of;
}
@F == 13 or next;
$F[3] > 0.9999 or next;
my $pair = join( "-", sort { $a <=> $b } ( $F[0], $F[1], ) );
next if $seen{$pair};
$seen{$pair} = $_;
$count_of{ $F[0] }++;
$count_of{ $F[1] }++;
END {
for my $pair ( keys %seen ) {
my ($f_id, $g_id) = split "-", $pair;
next if $count_of{$f_id} > 2;
next if $count_of{$g_id} > 2;
print $seen{$pair};
}
}
' \
| sort -k 1n,1n -k 2n,2n \
> anchorLong/anchor.ovlp.tsv
ANCHOR_COUNT=$(faops n50 -H -N 0 -C anchorLong/anchor.fasta)
echo ${ANCHOR_COUNT}
rm -fr anchorLong/group
anchr group \
anchorLong/anchorLong.db \
anchorLong/anchorLong.ovlp.tsv \
--oa anchorLong/anchor.ovlp.tsv \
--parallel 16 \
--range "1-${ANCHOR_COUNT}" --len 1000 --idt 0.98 --max "-14" -c 4 --png
pushd ${BASE_DIR}/anchorLong
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr overlap --len 10 --idt 0.9999 \
group/{}.strand.fasta \
-o stdout \
| perl -nla -e '\''
@F == 13 or next;
$F[3] > 0.98 or next;
$F[9] == 0 or next;
$F[5] > 0 and $F[6] == $F[7] or next;
/anchor.+anchor/ or next;
print;
'\'' \
> group/{}.anchor.ovlp.tsv
anchr layout \
group/{}.ovlp.tsv \
group/{}.relation.tsv \
group/{}.strand.fasta \
--oa group/{}.anchor.ovlp.tsv \
--png \
-o group/{}.contig.fasta
'
popd
# false strand
cat anchorLong/group/*.ovlp.tsv \
| perl -nla -e '/anchor.+long/ or next; print $F[0] if $F[8] == 1;' \
| sort | uniq -c
cat \
anchorLong/group/non_grouped.fasta\
anchorLong/group/*.contig.fasta \
| faops filter -l 0 -a 1000 stdin anchorLong/contig.fasta
```
* contigTrim
```bash
BASE_DIR=$HOME/data/anchr/Ngon
cd ${BASE_DIR}
rm -fr contigTrim
anchr overlap2 \
--parallel 16 \
anchorLong/contig.fasta \
canu-raw-40x/Ngon.contigs.fasta \
-d contigTrim \
-b 20 --len 1000 --idt 0.98 --all
CONTIG_COUNT=$(faops n50 -H -N 0 -C contigTrim/anchor.fasta)
echo ${CONTIG_COUNT}
rm -fr contigTrim/group
anchr group \
--parallel 16 \
--keep \
contigTrim/anchorLong.db \
contigTrim/anchorLong.ovlp.tsv \
--range "1-${CONTIG_COUNT}" --len 1000 --idt 0.98 --max 20000 -c 1
pushd ${BASE_DIR}/contigTrim
cat group/groups.txt \
| parallel --no-run-if-empty -j 8 '
echo {};
anchr orient \
--len 1000 --idt 0.98 \
group/{}.anchor.fasta \
group/{}.long.fasta \
-r group/{}.restrict.tsv \
-o group/{}.strand.fasta;
anchr overlap --len 1000 --idt 0.98 \
group/{}.strand.fasta \
-o stdout \
| anchr restrict \
stdin group/{}.restrict.tsv \
-o group/{}.ovlp.tsv;
anchr layout \
doc/bacteria_2_3.md view on Meta::CPAN
" ::: 25 30 ::: 60 ::: 40 80 120 160 ::: 000 001 002 003 004 005 006 \
>> stat2.md
cat stat2.md
```
| Name | SumCor | CovCor | N50SR | Sum | # | N50Anchor | Sum | # | N50Others | Sum | # | Kmer | RunTimeKU | RunTimeAN |
|:---------------|--------:|-------:|------:|------:|----:|----------:|------:|----:|----------:|--------:|----:|--------------------:|----------:|:----------|
| Q25L60X40P000 | 90.89M | 40.0 | 8433 | 2.12M | 391 | 8591 | 2.04M | 321 | 961 | 76.91K | 70 | "31,41,51,61,71,81" | 0:02'53'' | 0:01'13'' |
| Q25L60X40P001 | 90.89M | 40.0 | 8424 | 2.14M | 392 | 8409 | 2.04M | 331 | 9874 | 102.57K | 61 | "31,41,51,61,71,81" | 0:02'52'' | 0:00'55'' |
| Q25L60X40P002 | 90.89M | 40.0 | 8424 | 2.16M | 401 | 8526 | 2.03M | 320 | 5808 | 138.15K | 81 | "31,41,51,61,71,81" | 0:02'47'' | 0:01'12'' |
| Q25L60X80P000 | 181.79M | 80.0 | 8256 | 2.14M | 424 | 8379 | 2.05M | 347 | 951 | 84.91K | 77 | "31,41,51,61,71,81" | 0:04'33'' | 0:01'37'' |
| Q25L60X120P000 | 272.68M | 120.0 | 7764 | 2.15M | 477 | 7854 | 2.05M | 372 | 832 | 98.28K | 105 | "31,41,51,61,71,81" | 0:05'58'' | 0:02'04'' |
| Q30L60X40P000 | 90.89M | 40.0 | 8732 | 2.12M | 392 | 8901 | 2.04M | 310 | 867 | 76.48K | 82 | "31,41,51,61,71,81" | 0:03'06'' | 0:01'17'' |
| Q30L60X40P001 | 90.89M | 40.0 | 8720 | 2.11M | 392 | 8871 | 2.06M | 315 | 706 | 55.09K | 77 | "31,41,51,61,71,81" | 0:02'44'' | 0:01'05'' |
| Q30L60X80P000 | 181.79M | 80.0 | 9268 | 2.13M | 369 | 9632 | 2.05M | 302 | 935 | 76.24K | 67 | "31,41,51,61,71,81" | 0:02'41'' | 0:01'29'' |
## Nmen: merge anchors
```bash
BASE_NAME=Nmen
cd ${HOME}/data/anchr/${BASE_NAME}
# merge anchors
mkdir -p merge
anchr contained \
$(
parallel -k --no-run-if-empty -j 6 "
if [ -e Q{1}L{2}X{3}P{4}/anchor/pe.anchor.fa ]; then
echo Q{1}L{2}X{3}P{4}/anchor/pe.anchor.fa
fi
" ::: 25 30 ::: 60 ::: 40 80 120 160 ::: 000 001 002 003 004 005 006
) \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
mkdir -p merge
anchr contained \
$(
parallel -k --no-run-if-empty -j 6 "
if [ -e Q{1}L{2}X{3}P{4}/anchor/pe.others.fa ]; then
echo Q{1}L{2}X{3}P{4}/anchor/pe.others.fa
fi
" ::: 25 30 ::: 60 ::: 40 80 120 160 ::: 000 001 002 003 004 005 006
) \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# anchors sorted on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
## Nmen: 3GS
```bash
BASE_DIR=$HOME/data/anchr/Nmen
cd ${BASE_DIR}
canu \
-p Nmen -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=2.3m \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p Nmen -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=2.3m \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/Nmen.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/Nmen.trimmedReads.fasta.gz
```
## Nmen: expand anchors
* anchorLong
```bash
BASE_NAME=Nmen
cd ${HOME}/data/anchr/${BASE_NAME}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
doc/bacteria_2_3.md view on Meta::CPAN
| Q30L60_3000000 | 554.99M | 135.8 | 92 | "41,61,81" | 516.82M | 6.878% | 4.09M | 4.35M | 1.07 | 3.46M | 0 | 0:05'33'' |
| Name | N50SR | Sum | # | N50Anchor | Sum | # | N50Others | Sum | # | RunTime |
|:---------------|------:|------:|-----:|----------:|------:|-----:|----------:|--------:|-----:|----------:|
| Q20L60_1000000 | 2742 | 3.35M | 1662 | 3114 | 2.96M | 1127 | 753 | 390.98K | 535 | 0:01'23'' |
| Q20L60_2000000 | 2254 | 3.49M | 2020 | 2579 | 2.94M | 1273 | 766 | 547.44K | 747 | 0:01'51'' |
| Q20L60_3000000 | 1735 | 3.49M | 2481 | 2108 | 2.64M | 1335 | 766 | 842.39K | 1146 | 0:02'32'' |
| Q20L60_4000000 | 1386 | 3.42M | 2875 | 1793 | 2.27M | 1291 | 748 | 1.15M | 1584 | 0:02'51'' |
| Q20L60_5000000 | 1130 | 3.26M | 3134 | 1572 | 1.85M | 1169 | 742 | 1.41M | 1965 | 0:03'05'' |
| Q25L60_1000000 | 2807 | 3.31M | 1588 | 3210 | 2.93M | 1072 | 744 | 374.64K | 516 | 0:01'22'' |
| Q25L60_2000000 | 3211 | 3.46M | 1544 | 3556 | 3.13M | 1091 | 728 | 328.02K | 453 | 0:02'10'' |
| Q25L60_3000000 | 2914 | 3.53M | 1679 | 3223 | 3.14M | 1148 | 766 | 391.06K | 531 | 0:02'53'' |
| Q25L60_4000000 | 2532 | 3.58M | 1905 | 2838 | 3.1M | 1247 | 767 | 482.46K | 658 | 0:03'36'' |
| Q25L60_5000000 | 2192 | 3.61M | 2149 | 2563 | 3.01M | 1333 | 759 | 592.4K | 816 | 0:04'09'' |
| Q30L60_1000000 | 2433 | 3.16M | 1703 | 2778 | 2.7M | 1076 | 758 | 459.36K | 627 | 0:01'29'' |
| Q30L60_2000000 | 2858 | 3.36M | 1610 | 3251 | 2.98M | 1087 | 731 | 372.53K | 523 | 0:01'44'' |
| Q30L60_3000000 | 3136 | 3.46M | 1580 | 3503 | 3.1M | 1088 | 742 | 353.88K | 492 | 0:02'18'' |
## Bper: merge anchors
```bash
BASE_DIR=$HOME/data/anchr/Bper
cd ${BASE_DIR}
# merge anchors
mkdir -p merge
anchr contained \
Q20L60_1000000/anchor/pe.anchor.fa \
Q20L60_2000000/anchor/pe.anchor.fa \
Q20L60_3000000/anchor/pe.anchor.fa \
Q20L60_4000000/anchor/pe.anchor.fa \
Q25L60_1000000/anchor/pe.anchor.fa \
Q25L60_2000000/anchor/pe.anchor.fa \
Q25L60_3000000/anchor/pe.anchor.fa \
Q25L60_4000000/anchor/pe.anchor.fa \
Q30L60_1000000/anchor/pe.anchor.fa \
Q30L60_2000000/anchor/pe.anchor.fa \
Q30L60_3000000/anchor/pe.anchor.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
anchr contained \
Q20L60_2000000/anchor/pe.others.fa \
Q25L60_2000000/anchor/pe.others.fa \
Q30L60_2000000/anchor/pe.others.fa \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# sort on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
* Stats
```bash
BASE_DIR=$HOME/data/anchr/Bper
cd ${BASE_DIR}
printf "| %s | %s | %s | %s |\n" \
"Name" "N50" "Sum" "#" \
> stat3.md
printf "|:--|--:|--:|--:|\n" >> stat3.md
printf "| %s | %s | %s | %s |\n" \
$(echo "Genome"; faops n50 -H -S -C 1_genome/genome.fa;) >> stat3.md
printf "| %s | %s | %s | %s |\n" \
$(echo "Paralogs"; faops n50 -H -S -C 1_genome/paralogs.fas;) >> stat3.md
printf "| %s | %s | %s | %s |\n" \
$(echo "anchor.merge"; faops n50 -H -S -C merge/anchor.merge.fasta;) >> stat3.md
printf "| %s | %s | %s | %s |\n" \
$(echo "others.merge"; faops n50 -H -S -C merge/others.merge.fasta;) >> stat3.md
cat stat3.md
```
| Name | N50 | Sum | # |
|:-------------|--------:|--------:|----:|
| Genome | 4086189 | 4086189 | 1 |
| Paralogs | | | |
| anchor.merge | 4674 | 3478267 | 986 |
| others.merge | 1024 | 52609 | 49 |
* Clear QxxLxxx.
```bash
BASE_DIR=$HOME/data/anchr/Bper
cd ${BASE_DIR}
rm -fr 2_illumina/Q{20,25,30}L*
rm -fr Q{20,25,30}L*
```
# Corynebacterium diphtheriae FDAARGOS_197, ç½åæè
* Project
[SRP040661](https://trace.ncbi.nlm.nih.gov/Traces/sra/?study=SRP040661)
* Other name: ATCC 700971D-5; NCTC 13129;
doc/bacteria_2_3.md view on Meta::CPAN
| Q25L60X120P001 | 298.64M | 120.0 | 13839 | 2.46M | 290 | 13936 | 2.44M | 261 | 727 | 20.61K | 29 | "31,41,51,61,71,81" | 0:05'23'' | 0:02'34'' |
| Q25L60X160P000 | 398.18M | 160.0 | 6698 | 2.47M | 550 | 6848 | 2.42M | 479 | 727 | 50.73K | 71 | "31,41,51,61,71,81" | 0:07'01'' | 0:03'12'' |
| Q25L60X240P000 | 597.27M | 240.0 | 4746 | 2.47M | 759 | 4908 | 2.38M | 627 | 778 | 95.9K | 132 | "31,41,51,61,71,81" | 0:09'39'' | 0:03'43'' |
| Q30L60X40P000 | 99.55M | 40.0 | 55218 | 2.46M | 91 | 55218 | 2.44M | 81 | 10398 | 17.13K | 10 | "31,41,51,61,71,81" | 0:03'05'' | 0:01'35'' |
| Q30L60X40P001 | 99.55M | 40.0 | 55749 | 2.45M | 93 | 55749 | 2.45M | 85 | 844 | 6.42K | 8 | "31,41,51,61,71,81" | 0:02'52'' | 0:01'35'' |
| Q30L60X40P002 | 99.55M | 40.0 | 65454 | 2.46M | 75 | 65454 | 2.44M | 62 | 1126 | 13.91K | 13 | "31,41,51,61,71,81" | 0:03'01'' | 0:01'37'' |
| Q30L60X40P003 | 99.55M | 40.0 | 97954 | 2.45M | 68 | 97954 | 2.45M | 62 | 834 | 4.77K | 6 | "31,41,51,61,71,81" | 0:02'53'' | 0:01'25'' |
| Q30L60X40P004 | 99.55M | 40.0 | 71924 | 2.45M | 76 | 71924 | 2.45M | 67 | 727 | 6.18K | 9 | "31,41,51,61,71,81" | 0:02'54'' | 0:01'26'' |
| Q30L60X40P005 | 99.55M | 40.0 | 63766 | 2.45M | 88 | 63766 | 2.44M | 76 | 727 | 8.73K | 12 | "31,41,51,61,71,81" | 0:02'37'' | 0:01'26'' |
| Q30L60X80P000 | 199.09M | 80.0 | 60425 | 2.45M | 76 | 60425 | 2.45M | 70 | 753 | 4.59K | 6 | "31,41,51,61,71,81" | 0:04'00'' | 0:02'03'' |
| Q30L60X80P001 | 199.09M | 80.0 | 68973 | 2.45M | 64 | 68973 | 2.45M | 57 | 844 | 5.27K | 7 | "31,41,51,61,71,81" | 0:04'02'' | 0:02'00'' |
| Q30L60X80P002 | 199.09M | 80.0 | 89791 | 2.45M | 65 | 89791 | 2.45M | 58 | 809 | 5.53K | 7 | "31,41,51,61,71,81" | 0:04'01'' | 0:02'08'' |
| Q30L60X120P000 | 298.64M | 120.0 | 60425 | 2.45M | 74 | 60427 | 2.45M | 67 | 727 | 5.37K | 7 | "31,41,51,61,71,81" | 0:05'23'' | 0:02'27'' |
| Q30L60X120P001 | 298.64M | 120.0 | 71924 | 2.45M | 62 | 71924 | 2.44M | 56 | 844 | 4.9K | 6 | "31,41,51,61,71,81" | 0:05'18'' | 0:02'36'' |
| Q30L60X160P000 | 398.18M | 160.0 | 60427 | 2.45M | 75 | 60427 | 2.45M | 68 | 727 | 5.37K | 7 | "31,41,51,61,71,81" | 0:06'26'' | 0:03'04'' |
| Q30L60X240P000 | 597.27M | 240.0 | 57594 | 2.45M | 86 | 59198 | 2.44M | 74 | 844 | 9.05K | 12 | "31,41,51,61,71,81" | 0:06'47'' | 0:03'28'' |
## Cdip: merge anchors
```bash
BASE_NAME=Cdip
cd ${HOME}/data/anchr/${BASE_NAME}
# merge anchors
mkdir -p merge
anchr contained \
$(
parallel -k --no-run-if-empty -j 6 "
if [ -e Q{1}L{2}X{3}P{4}/anchor/pe.anchor.fa ]; then
echo Q{1}L{2}X{3}P{4}/anchor/pe.anchor.fa
fi
" ::: 25 30 ::: 60 ::: 40 80 120 160 240 ::: 000 001 002 003 004 005 006
) \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
mkdir -p merge
anchr contained \
$(
parallel -k --no-run-if-empty -j 6 "
if [ -e Q{1}L{2}X{3}P{4}/anchor/pe.others.fa ]; then
echo Q{1}L{2}X{3}P{4}/anchor/pe.others.fa
fi
" ::: 25 30 ::: 60 ::: 40 80 120 160 240 ::: 000 001 002 003 004 005 006
) \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# anchors sorted on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
## Cdip: 3GS
```bash
BASE_NAME=Cdip
REAL_G=2488635
cd $HOME/data/anchr/${BASE_NAME}
canu \
-p ${BASE_NAME} -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=${REAL_G} \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p ${BASE_NAME} -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=${REAL_G} \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/${BASE_NAME}.trimmedReads.fasta.gz
```
## Cdip: expand anchors
* anchorLong
```bash
BASE_NAME=Cdip
cd ${HOME}/data/anchr/${BASE_NAME}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
doc/bacteria_2_3.md view on Meta::CPAN
| Q25L60X40P000 | 75.71M | 40.0 | 35248 | 1.8M | 72 | 35248 | 1.8M | 71 | 865 | 865 | 1 | "31,41,51,61,71,81" | 0:01'13'' | 0:00'52'' |
| Q25L60X40P001 | 75.71M | 40.0 | 32751 | 1.8M | 75 | 32751 | 1.79M | 72 | 4293 | 9.43K | 3 | "31,41,51,61,71,81" | 0:01'15'' | 0:00'52'' |
| Q25L60X40P002 | 75.71M | 40.0 | 32751 | 1.8M | 76 | 32751 | 1.79M | 73 | 4293 | 9.45K | 3 | "31,41,51,61,71,81" | 0:01'13'' | 0:00'54'' |
| Q25L60X40P003 | 75.71M | 40.0 | 32751 | 1.82M | 75 | 32803 | 1.77M | 72 | 23232 | 47.32K | 3 | "31,41,51,61,71,81" | 0:01'14'' | 0:00'47'' |
| Q25L60X80P000 | 151.42M | 80.0 | 32751 | 1.8M | 78 | 32751 | 1.8M | 74 | 645 | 2.58K | 4 | "31,41,51,61,71,81" | 0:01'48'' | 0:01'09'' |
| Q25L60X80P001 | 151.42M | 80.0 | 31667 | 1.8M | 79 | 31667 | 1.8M | 77 | 865 | 1.44K | 2 | "31,41,51,61,71,81" | 0:01'49'' | 0:01'12'' |
| Q25L60X120P000 | 227.13M | 120.0 | 32404 | 1.8M | 83 | 32404 | 1.8M | 78 | 650 | 3.55K | 5 | "31,41,51,61,71,81" | 0:02'27'' | 0:01'21'' |
| Q25L60X160P000 | 302.84M | 160.0 | 31667 | 1.8M | 84 | 31667 | 1.8M | 83 | 865 | 865 | 1 | "31,41,51,61,71,81" | 0:03'05'' | 0:01'42'' |
| Q30L60X40P000 | 75.71M | 40.0 | 35248 | 1.8M | 72 | 35248 | 1.8M | 71 | 855 | 855 | 1 | "31,41,51,61,71,81" | 0:01'14'' | 0:00'56'' |
| Q30L60X40P001 | 75.71M | 40.0 | 32751 | 1.84M | 76 | 32813 | 1.76M | 71 | 32374 | 74.19K | 5 | "31,41,51,61,71,81" | 0:01'13'' | 0:00'45'' |
| Q30L60X40P002 | 75.71M | 40.0 | 32751 | 1.8M | 73 | 32751 | 1.8M | 72 | 855 | 855 | 1 | "31,41,51,61,71,81" | 0:01'13'' | 0:00'44'' |
| Q30L60X40P003 | 75.71M | 40.0 | 32741 | 1.8M | 75 | 32741 | 1.8M | 74 | 865 | 865 | 1 | "31,41,51,61,71,81" | 0:01'13'' | 0:00'45'' |
| Q30L60X80P000 | 151.42M | 80.0 | 32751 | 1.8M | 74 | 32751 | 1.8M | 73 | 865 | 865 | 1 | "31,41,51,61,71,81" | 0:01'49'' | 0:01'08'' |
| Q30L60X80P001 | 151.42M | 80.0 | 32751 | 1.8M | 74 | 32751 | 1.8M | 73 | 865 | 865 | 1 | "31,41,51,61,71,81" | 0:01'50'' | 0:01'12'' |
| Q30L60X120P000 | 227.13M | 120.0 | 32751 | 1.8M | 77 | 32751 | 1.8M | 75 | 865 | 1.49K | 2 | "31,41,51,61,71,81" | 0:02'26'' | 0:01'32'' |
| Q30L60X160P000 | 302.84M | 160.0 | 32404 | 1.8M | 79 | 32404 | 1.8M | 77 | 865 | 1.49K | 2 | "31,41,51,61,71,81" | 0:03'00'' | 0:01'37'' |
## Ftul: merge anchors
```bash
BASE_NAME=Ftul
cd ${HOME}/data/anchr/${BASE_NAME}
# merge anchors
mkdir -p merge
anchr contained \
$(
parallel -k --no-run-if-empty -j 6 "
if [ -e Q{1}L{2}X{3}P{4}/anchor/pe.anchor.fa ]; then
echo Q{1}L{2}X{3}P{4}/anchor/pe.anchor.fa
fi
" ::: 25 30 ::: 60 ::: 40 80 120 160 ::: 000 001 002 003 004 005 006
) \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.contained.fasta
anchr orient merge/anchor.contained.fasta --len 1000 --idt 0.98 -o merge/anchor.orient.fasta
anchr merge merge/anchor.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/anchor.merge.fasta
# merge others
mkdir -p merge
anchr contained \
$(
parallel -k --no-run-if-empty -j 6 "
if [ -e Q{1}L{2}X{3}P{4}/anchor/pe.others.fa ]; then
echo Q{1}L{2}X{3}P{4}/anchor/pe.others.fa
fi
" ::: 25 30 ::: 60 ::: 40 80 120 160 ::: 000 001 002 003 004 005 006
) \
--len 1000 --idt 0.98 --proportion 0.99999 --parallel 16 \
-o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.contained.fasta
anchr orient merge/others.contained.fasta --len 1000 --idt 0.98 -o merge/others.orient.fasta
anchr merge merge/others.orient.fasta --len 1000 --idt 0.999 -o stdout \
| faops filter -a 1000 -l 0 stdin merge/others.merge.fasta
# anchors sorted on ref
bash ~/Scripts/cpan/App-Anchr/share/sort_on_ref.sh merge/anchor.merge.fasta 1_genome/genome.fa merge/anchor.sort
nucmer -l 200 1_genome/genome.fa merge/anchor.sort.fa
mummerplot -png out.delta -p anchor.sort --large
# mummerplot files
rm *.[fr]plot
rm out.delta
rm *.gp
mv anchor.sort.png merge/
# quast
rm -fr 9_qa
quast --no-check --threads 16 \
-R 1_genome/genome.fa \
merge/anchor.merge.fasta \
merge/others.merge.fasta \
1_genome/paralogs.fas \
--label "merge,others,paralogs" \
-o 9_qa
```
## Ftul: 3GS
```bash
BASE_NAME=Ftul
GENOME_SIZE=1.9m
cd $HOME/data/anchr/${BASE_NAME}
canu \
-p ${BASE_NAME} -d canu-raw-40x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=${GENOME_SIZE} \
-pacbio-raw 3_pacbio/pacbio.40x.fasta
canu \
-p ${BASE_NAME} -d canu-raw-80x \
gnuplot=$(brew --prefix)/Cellar/$(brew list --versions gnuplot | sed 's/ /\//')/bin/gnuplot \
genomeSize=${GENOME_SIZE} \
-pacbio-raw 3_pacbio/pacbio.80x.fasta
faops n50 -S -C canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz
faops n50 -S -C canu-raw-80x/${BASE_NAME}.trimmedReads.fasta.gz
```
## Ftul: expand anchors
* anchorLong
```bash
BASE_NAME=Ftul
cd ${HOME}/data/anchr/${BASE_NAME}
anchr cover \
--parallel 16 \
-c 2 -m 40 \
-b 20 --len 1000 --idt 0.9 \
merge/anchor.merge.fasta \
canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz \
-o merge/anchor.cover.fasta
rm -fr anchorLong
anchr overlap2 \
--parallel 16 \
merge/anchor.cover.fasta \
canu-raw-40x/${BASE_NAME}.trimmedReads.fasta.gz \
-d anchorLong \
-b 20 --len 1000 --idt 0.98
( run in 1.008 second using v1.01-cache-2.11-cpan-788537b7465 )