-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsupplement-tables.R
65 lines (63 loc) · 2.9 KB
/
supplement-tables.R
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
setwd("~/phd/research/spatial_sweeps/")
library(tidyverse)
library(data.table)
library(stats)
# outlier snps table
allsnps <- fread('anopheles/out/all_snps_genome_scan_annotated.txt')
allsnps <- allsnps[allsnps$outlier,]
outliersnps <- allsnps %>% select(c('chromosome',
'position',
'alternate',
'frequency',
'area',
'annotation',
'impact',
'Gene ID',
'Product Description',
'INV',
'nstat_outlier',
'nstat')) %>%
rename(!!c('alternate_allele'='alternate',
'SNPEff_annotation'='annotation',
'SNPEff_impact'='impact',
'Ensembl_gene_id'='Gene ID',
'product_description'='Product Description',
'inversion'='INV',
'window_outlier'='nstat_outlier',
'window_zscore'='nstat'))
fwrite(outliersnps, 'supp-data/outlier_snps.txt', sep='\t')
# missense snps table
nssnps <- fread('anopheles/out/missense_snps_stabilitychange.txt')
nssnps <- nssnps %>% select(c('chromosome',
'position',
'alternate',
'frequency',
'area',
'annotation',
'impact',
'Gene ID',
'source_id',
'Product Description',
'ancestral_allele',
'derived_allele',
'Mutation',
'ddG (kcal/mol)',
'UniProt ID(s)',
'INV',
'nstat_outlier',
'nstat')) %>%
rename(!!c('alternate_allele'='alternate',
'SNPEff_annotation'='annotation',
'SNPEff_impact'='impact',
'Ensembl_gene_id'='Gene ID',
'transcript'='source_id',
'product_description'='Product Description',
'wt_NT' = 'ancestral_allele',
'mut_NT' = 'derived_allele',
'AA_change' = 'Mutation',
'ddG_kcal_mol' = 'ddG (kcal/mol)',
'uniprot_id' = 'UniProt ID(s)',
'inversion'='INV',
'window_outlier'='nstat_outlier',
'window_zscore'='nstat'))
fwrite(nssnps, 'supp-data/nonsynonymous_snps.txt', sep='\t')