-
Notifications
You must be signed in to change notification settings - Fork 0
/
AWK-oneLiner
21 lines (13 loc) · 1.06 KB
/
AWK-oneLiner
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#### Deleting all folders in a dir
rm -R `ls -1 -d */`
for f in BedGraph/*.cov ; do /home/ubuntu/bismark_v0.15.0/coverage2cytosine --genome_folder Wei_Genome/ -o $f BedGraph/$f; done
### Mapping DMCs to TAIR annotation and counting overlapping DRCs
bedtools intersect -a LE_BB_DML.smooth.CHG.input -b ../FINAL_RESULTS/TAIR.allFeatures.sorted.checked -wb | awk '{ a[$8]++ } END { for (n in a) print n, a[n] }'
## Removing duplicated entries with same column values
awk '!a[$1]++'
## Sorting bed file
sort -V -k1,1 -k2,2 infile.bed > infile.sort.bed
### Getting important columns from pfam output file
awk '{{for(i=23;i<=NF;++i) annotation =annotation " " $i;} print $1 "\t" $2 "\t" $4 "\t" $7 "\t" $13 "\t" annotation ; annotation =""}' cicar.Eval10.pfam |sed 's/'\''//g' > inputForExpTable
### Creating SQL command
awk -F "\t" -v q=\' '{print "INSERT INTO pfam_table (target, accession, query_name, Evalue_full, Evalue_domain, description ) values ( " q $1 q ", " q $2 q ", " q $3 q ", " $4 ", " $5 ", " q $6 q ");"}' inputForExpTable > SQL_commands_pfamTable