-
Notifications
You must be signed in to change notification settings - Fork 2
/
used_commands.txt
executable file
·29 lines (22 loc) · 1.27 KB
/
used_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/bash
##Plotting mitochondrial genomes with a fasta of your genome, MITOS server, and CIRCOS plotting app
GENOME=../../Vargula_tsujii_mtDNA_v2_TRF.fasta
BEDFILE=../MITOS2/Vargula_tsujii_mtDNA_v2.bed.txt
NAME=Vargula_tsujii_mtDNA_v2_TRF ##Name has to match whats in the 1st column of the BED file.
##Check if the FASTA newlines are DOS. This screwed up some software for me at least once.
doslines=$(hexdump -C $GENOME | grep "0d 0a" | wc -l)
if [ $doslines -gt '0' ]
then
echo "FASTA was in DOS format (CRLF). Converting to UNIX format."
fromdos $GENOME
fi
##Figure out how long the mitochondrial genome is
/lab/solexa_weng/testtube/seqkit stat $GENOME
GENOME_LENGTH=$(/lab/solexa_weng/testtube/seqkit stat $GENOME | grep "FASTA" | tr -s " " | cut -d " " -f 5 | tr -d ",")
GENOME_LENGTH=$(expr $GENOME_LENGTH - 1)
echo "chr1 - mito mito 0 $GENOME_LENGTH black" > mitochondrial_genome.txt
cat $BEDFILE | sed "s/$NAME/mito/g" | sed "s/repeat_unit/IGNOREME/g" | cut -f 1,2,3,4 > Mitochondrial_elements.txt
cat Mitochondrial_elements.txt | grep -v "IGNOREME" | grep -v "trn" > no_tRNA_Mitochondrial_elements.txt
cat Mitochondrial_elements.txt | grep -v "IGNOREME" | grep "trn" > yes_tRNA_Mitochondrial_elements.txt
##Circos needs the various *.conf files in the same directory.
circos