-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
33 lines (24 loc) · 1.01 KB
/
Copy pathscript.py
File metadata and controls
33 lines (24 loc) · 1.01 KB
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
30
31
32
33
#Check my data through Colab :)
#Import the library to mount Google Drive
from google.colab import drive
#Mount Google Drive to access files there
drive.mount('/content/drive')
!sudo apt-get install -y bcftools
!sudo apt-get install -y vcftools
!sudo apt-get install -y samtools
#Set the directory for the outputs
output_dir = "/content/drive/My Drive/Path/to/project/"
#Check...
!ls "/content/drive/My Drive/"
#Defining the name of the COVID data file for analysis
my_data = "variant_data.vcf.gz"
!echo {my_data}
#Check summary statistics
!bcftools stats {my_data} > {my_data}_stats.txt
#Filtering and saving specific information from the generated statistics
grep "number of records:" {my_data}_stats.txt > {my_data}_stats.records.txt
grep "number of SNPs:" {my_data}_stats.txt > {my_data}_stats.SNPs.txt
grep "number of indels:" {my_data}_stats.txt > {my_data}_stats.indels.txt
#Assess mapping qualities and coverage
samtools flagstat {my_data} > {my_data}_flagstat.txt
samtools coverage -m -o {my_data}_coverage.txt {my_data}