---
# System prepended metadata

title: Bioinformatic Tools

---

# Bioinformatic Tools

## Assignment 1

### Data overview
Short reads:
4000000 sequences with 150 bp length.

![](https://i.imgur.com/2dVBQeh.png)

Long reads:
2883 sequences with lengths varying from 18013-59220 bp.

![](https://i.imgur.com/lI0ACcM.png)


```
fastqc -o workspace/schneider_braun/a1_read_mapping/data_overview/ data/cami_2mil.fq.gz
```

`nanoQC -o workspace/schneider_braun/a1_read_mapping/data_overview/ data/Bioreactor_80mil.fq.gz ` 

### Short read alignment
```
samtools sort workspace/shortreads/alignment_sr_minimap.sam -o workspace/shortreads/alignment_sr_sorted.sam -O sam
```

## Thomas Commands
```
samtools index output_short_sorted.bam 

```

```
samtools sort output_short.bam > output_short_sorted.bam

```

```
samtools view -T bac_complete_rep_type.fna -b output_short.sam > output_short.bam

```

```
minimap2 -ax sr -t 2 /nfs/wsi/ab/projects/tools_course_WS2021/db/bac_complete_rep_type.fna.gz /nfs/wsi/ab/projects/tools_course_WS2021/data/cami_2mil.fq.gz > output_short.sam 

```

```
fastqc --nano -o /nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/a1_read_mapping/data_overview/ /nfs/wsi/ab/projects/tools_course_WS2021/data/Bioreactor_80mil.fq.gz 

```

# Day 2

## Make a diamond database 
```
workspace/schneider_braun/conda_thomas/diamond makedb -p 10 --in db/annotree.fasta.gz -d workspace/schneider_braun/a1_read_mapping/short_reads_alignment/diamond_short_alignment/ann_reference

```
## Diamond
```
diamond blastx -F 15 --top 10 --range-culling -p 10 -d schneider_braun/a1_read_mapping/short_reads_alignment/diamond_short_alignment/ann_reference.dmnd -q ../data/Bioreactor_80mil.fq.gz -o schneider_braun/a1_read_mapping/long_reads_alignment/long_reads_aln.daa -f 100

```
## Minimap indexing
```
minimap2 -a bac_index.mmi /nfs/wsi/ab/projects/tools_course_WS2021/data/cami_2mil.fq.gz -t 2 > output.sam
```

```
~/megan/tools/daa-meganizer -i long_reads_alignment/long_reads_aln.daa -mdb megan-mapping-annotree-June-2021.db
```
## Meganizing
```
/nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/a1_read_mapping$ ~/megan/tools/daa-meganizer -i /nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/a1_EJS/shortreads/alignment_prot.daa -mdb megan-mapping-annotree-June-2021.db

```

# Day 3
Assembly and Annotation:
* polish long-read assembly bc frameshifts
* What kind of file are we giving spades and megahit
* define k-mer size
* use scaffol instead of contigs 
* visualization with bandage

## (meta)Spades

```
spades.py --meta --12 /nfs/wsi/ab/projects/tools_course_WS2021/data/cami_2mil.fq.gz -k 21,33,55 -t 10 -o ./spades_output 
```

## Flye

```
/nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/conda_thomas/flye/Flye/bin/flye --nano-hq /nfs/wsi/ab/projects/tools_course_WS2021/data/Bioreactor_3bil.fq.gz --meta --iteration 0 --threads 16 --scaffold -o ./flye_out
```
##Long read assembly summary:

Total length:   74685184
Fragments:      663
Fragments N50:  394181
Largest frg:    3941922
Scaffolds:      0
Mean coverage:  28

## Polish with racon
```
./bin/racon -m 8 -x -6 -g -8 -w 500 -t 16 /nfs/wsi/ab/projects/tools_course_WS2021/data/Bioreactor_6bil.fq.gz /nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/a2_EJS/flye_assembly/mapping.sam /nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/a2_EJS/flye_assembly/assembly.fasta > /nfs/wsi/ab/projects/tools_course_WS2021/workspace/schneider_braun/a2_EJS/flye_assembly/racon.fasta 
```

# Day 4
* CheckM: completeness ideally over 90% over 50 is good
* make new env for checkM
* contigs treated as long reads (frameshift)

```

```
# Day 5
* Phylogeny
* consensus tree
* MSAs + MAFFT or Muscle --> Muscle very accurate but slow

# Day 6
## Papers to choose from:
* Quantification from Nanopore long reads
    * max 3 samples from metadata
* reconstruction of ancient microbial genomes from the human gut
    * max 3 samples
    * choose own way to represent data
* combined assembly of long and short sequencing reads improve the efficiency of exploring the soil metagenome
    * do maximum possible
    * ez paper
* short and long-read metagenomics
    * keep metadata in mind
    * dont use the sripts in the paper
    * can use tool commands
* Salvaging high-quality genomes
    * subset dataset