# dhQueRobu3 mitochondrion
- Auto-generated Table of Content
[ToC]
## 1 dhQueRobu3 - main sample
### 1.1 dhQueRobu3 MBG= 1001K

### 1.1.1 dhQueRobu3 path 1+,4+,5+,8+,6-,4-,2-,3+,9-,8-,7+,3-
1+,4+,5+,8+,6-,4-,2-,3+,9-,8-,7+,3-
36354 + 0 mapped (100.00% : N/A) reads mapped
bellow track 85359 + 0 mapped (100.00% : N/A)


When mapping reads fished by both, chloro and mito, we find some extra reads mapped.

9IXKF5.png)
The interesting thing is that, if we look closer, the region where in the top image is not very well covered with reads, is well coverage when we have the extra reads that also map to the chloroplast.

### 1.1.2 dhQueRobu3 path2 1+,4+,6+,8-,5-,4-,2-,3+,9-,8-,7+,3-
Mappings for the bellow path
1+,4+,6+,8-,5-,4-,2-,3+,9-,8-,7+,3-
36371 + 0 in total (QC-passed reads + QC-failed reads)
bellow track 85377 + 0 mapped (100.00% : N/A)


-
Nucmer of path1 and path2 after mitohifi

### 1.1.2.1 Stoichiometry
Ok, considering we can go 1+,4+,5+ or 1+,4+,6+ we wonder if we have one version that is more prevalent than another, and if we can see that by mapping the reads to those two.
```
samtools flagstat path-rep145MW771358.1.sorted.bam
28981 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
28981 + 0 mapped (100.00% : N/A)
```
```
(biopython) mu2@tol-head1:/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/mito_choro_mbg$ samtools flagstat path-rep146MW771358.1.sorted.bam
17295 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
17295 + 0 mapped (100.00% : N/A)
```
Ok, considering we can go 3-,1+,4+,5+ or 3-,1+,4+,6+
```
samtools flagstat path-rep3145.mappedallreads.sorted.bam
43203 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
43203 + 0 mapped (100.00% : N/A)
```
```
samtools flagstat path-rep3146.mappedallreads.sorted.bam
64692 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
64692 + 0 mapped (100.00% : N/A)
```
```
(biopython) mu2@tol-head1:/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/mito_choro_mbg$ samtools flagstat path-rep3145.mappedallreads.sorted.noclips.bam
4349 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
4349 + 0 mapped (100.00% : N/A)
```
```
(biopython) mu2@tol-head1:/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/mito_choro_mbg$ samtools flagstat path-rep3146.mappedallreads.sorted.noclips.bam
12789 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
0 + 0 duplicates
12789 + 0 mapped (100.00% : N/A)
```
----------------------------------------------------------------
### 1.2 dhQueRobu3 MBG= 5001K

----------------------------------------------------------------
### 1.3 dhQueRobu3 modified MBG
```
mu2@tol-head2:/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/mito_choro_mbg/mito_choro_mbg-modified$ echo '/software/team311/mu2/mito_experiment_MBG/MBG/bin/MBG --output-sequence-paths paths.gaf --resolve-maxk 10000 -k 1001 -w 250 -t 18 -a 2 -u 20 -i NC_057248.1.MW771358.1.fasta.BOTH.HiFiMapped.bam.fasta -o mbg.gfa ' | bsub -n18 -q long -R"span[hosts=1] select[mem>55000] rusage[mem=55000]" -M55000 -P team311 -o mbg.%J -e er.mbg.%J
```

### 1.3.1
From here Max made a fake molecule on the junctions and I blast read to this junctions:
| Junction ID | 99% length on blast | Column 3 |
| -------- | -------- | -------- |
| 228(+)->227(+) | | Text |
### 1.3.2
Mito3
mito3 229+,227+,230-,231+,228+,232-,233+
```
# Related mitogenome is 504730 bp long and has 78 genes
contig_id frameshifts_found genbank_file length(bp) number_of_genes
final_mitogenome ORF1;ORF3;ORF13;atp9 final_mitogenome.gb 390906 75
```
rotated to start at tnra-Phe

Mito1
mito1 229+,227+,230-,232+,228-,231-,233+
```
# Related mitogenome is 504730 bp long and has 78 genes
contig_id frameshifts_found genbank_file length(bp) number_of_genes
final_mitogenome ORF1;atp9;ORF13;ORF3 final_mitogenome.gb 390906 75
```

Mito1 rotated to starte at trna-Phe

Mito2
Reverse complement of:
mito2 229+,232-,230+,227-,228-,233-,231+
```
# Related mitogenome is 504730 bp long and has 78 genes
contig_id frameshifts_found genbank_file length(bp) number_of_genes
final_mitogenome ORF3;ORF13;ORF1;atp9 final_mitogenome.gb 390906 75
```

Mito 2 rotated to start at trna-Phe

### 1.3.3 A
Looking at the repeat sequences in the graph
```
Sequence 227 36236 bp
Sequence 228 38559 bp
Sequence 231 28271 bp
Sequence 232 20586 bp
```
231 and 232 have much the same sequence

Path to file: ```/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/mito_choro_mbg/mito_choro_mbg-modified/232-231.aln```
### 1.3.3 B
For the other two repeats, they are not so much the same. I've done a clustal with the sequences and with one of them reverse complemented.
**228 and 227
**

**228RC and 227**

## 2 DTOL10185075-Branch1A
### 2.1 MBG k=1001
This MBG was ran with mito and chloro to fish. Reference for fishing were LT996900.1.MW771358.1.


### 2.2 MBG k=5001

We are not seeing the mitochondria most likely because it doesn't have enought coverage in the sample and MBG was ran as ```MBG -k 1001 -w 250 -a 5 -u 150 ```
Mapping reads to the mitohifi-1k.1+4+5+8+6-4-2-3+9-8-7+3- version of the mito in the main sample, we see reads covering its entirity:

### 2.2.1 MBG k=1001 -w 70 -u 40
As I decrease w and u we see the mito graph!

5+,7+,9+,11+,8-,7-,4-,6+,12+,11-,10+,6-
Innitial size
mito 392335
Mito circularization: mito (True, 0, 1429)
After mitohifi
```
contig_id frameshifts_found genbank_file length(bp) number_of_genes
final_mitogenome ORF3;ORF1;atp9;ORF13 final_mitogenome.gb 390906 75
```
### 2.2.2 MBG modified
### 2.2.2.1 MBG modified with filtered reads
```
/software/team311/mu2/mito_experiment_MBG/MBG/bin/MBG --output-sequence-paths out/paths.gaf --resolve-maxk 10000 -k 1001 -w 250 -t 8 -a 2 -u 20 -i MW771358.1.NC_057248.1.fasta.BOTH.HiFiMapped.bam.fasta -o out/mbg.gfa
```

```
/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/dhQueRobu3-resequencing/DTOL10185075-Branch1A/MBG-mod-filtReads/out
```
Path
mito9+13-12+8+10-11+.fa
Final size= 396678
Circularization points: (True, 0, 5777)
```
contig_id frameshifts_found genbank_file length(bp) number_of_genes
final_mitogenome ATP6;rpl2 final_mitogenome.gb 390901 58
```
### 2.2.2.2 MBG mofidied with ALL reads

## 3 DTOL10185076_Branch_1b MBG k=1001 -w 70 -u 40

15+,16-,8-,10-,13+,16+,14-,12-,11+,10-,9+,12+
## 4 OakPopGen10218312_Branch_2
### 4.1 OakPopGen10218312_Branch_2 w70 u40 k=1001

15+,39+,10-,12+,14+,39-,16-,17+,13-,12-,11+,17-
### 4.1.1 OakPopGen10218312_Branch_2 -w 250 -a 5 -u 150 k=5001

### 4.1.2 OakPopGen10218312_Branch_2 -w 250 -a 5 -u 150 k=1001

## 5.1 DTOL10185078_Branch_3B -w 250 -a 5 -u 150 k=1001

### 5.2 DTOL10185078_Branch_3B -w 70 -u 40 k=1001

---------------------------------------------------------
### 5.3 MBg modified
```
mu2@tol-head2:/lustre/scratch116/tol/projects/darwin/data/dicots/Filipendula_ulmaria/working/hifiasm_meta/hifiasm_meta-onlymitochlororeads$ echo '/software/team311/mu2/hifiasm-meta/hifiasm_meta -t18 -o asm_default drFilUlma1.NC_057524.1.NC_057524.fasta.BOTH.HiFiMapped.bam.fasta.gz 2>asm-default.log ' | bsub -n18 -q long -R"span[hosts=1] select[mem>75000] rusage[mem=75000]" -M75000 -P team311 -o hifiasmmeta.%J -e er.hifiasmmeta.%J
Job <211174> is submitted to queue <long>
```

## 6 DTOL10185079_Branch_4A k=1001 -w 250 -a 5 -u 150

1+4+5+8+6-4-2-3+7-8+9+
### 6.1 DTOL10185079_Branch_4A Modified mbg

## 7 DTOL10185080_Branch_4B w70 u40 k=1001––––
---

------------------------
### 7.1 DTOL10185080_Branch_4B MBG modified

## 8 DTOL10185081_Branch_4C w70 u40 k=1001

For the above we don't see a mito assembled with any of the two sets of parameters. Then I went and mapped the fished reads to the version of the main sample (as in 2.2) and we see a coverage of 71 for mostly the whole molecule

So I'm trying most reads are beeing drown to the chloroplast?
So I'll try to assemble the reads fish only by the mito. Need the change the parameters wven further.
MBG k1001 w30 u10

6+8-9+3-1+4+5+8-7+3-2-4+
## 9 DTOL10185082-Branch-4D k1001 u5 w20

Figure bellow is the same idea as before, as I dont have a circular mito, I decided to take jus the reads mapped to the mito (like 2.2) and map to the reference. The reads mapping to branch-4D is the botton track (the above track is 8, I left it there cause its interesting to check the SNPS between the two.)

Rebuid with last MBG version outsequencepaths
## 10 DTOL10185083-Branch-4E
Hasn't been able to assembled it with modified MBG
## 11 DTOL10185088-Branch-6C
```
mu2@tol-head2:/lustre/scratch116/tol/projects/darwin/data/dicots/Quercus_robur/working/dhQueRobu3-resequencing/DTOL10185088-Branch-6C$ echo '/software/team311/mu2/mito_experiment_MBG/MBG/bin/MBG --output-sequence-paths modifiedMBG.paths.gaf --resolve-maxk 10000 -k 1001 -w 250 -t 8 -a 2 -u 20 -i mitohifi-1k.1+4+5+8+6-4-2-3+9-8-7+3-LT996900.1.fasta.BOTH.HiFiMapped.bam.fasta -o modifiedMBG.gfa ' | bsub -n8 -q long -R"span[hosts=1] select[mem>55000] rusage[mem=55000]" -M55000 -P team311 -o mbg.%J -e er.mbg.%J
Job <214494> is submitted to queue <long>.
```
