SELECT
chr as chr,
pos as start,
'+' as strand,
cast (CT_count as float) as CT_count,
cast (C_count as float) as C_count,
cast (C_count as float) / cast (CT_count as float) as freqC,
1 - (cast (C_count as float) / cast (CT_count as float)) as freqT
FROM [sr320@washington.edu].[BiGo_lar_M1]
where
context like '__CG_'
and
CT_Count >= 5
and
ratio <> 'NA'
!head /Volumes/web/cnidarian/BiGo_lar_M1_methylkit2_input.csv
!tail -n +2 /Volumes/web/cnidarian/BiGo_lar_M1_methylkit2_input.csv > /Volumes/web/cnidarian/BiGo_lar_M1_methylkit2_c.csv
!head /Volumes/web/cnidarian/BiGo_lar_M1_methylkit2_c.csv
!tr ',' "\t" </Volumes/web/cnidarian/BiGo_lar_M1_methylkit2_c.csv> /Volumes/web/cnidarian/BiGo_lar_M1_methylkit2.txt
!head /Volumes/web/cnidarian/BiGo_lar_M1_methylkit2.txt
!head /Volumes/web/cnidarian/BiGo_lar_M1_methylkit3_input.csv
python tool to download hack
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr + '_' + (cast (pos as varchar)) as chr_start, chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC, 1 - (cast (C_count as float) / cast (CT_count as float)) as freqT FROM [sr320@washington.edu].[BiGo_lar_M1] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -f tsv -o /Volumes/Monarch/cnidary/BiGo_lar_M1_methylkit4_input.txt
!head /Volumes/Monarch/cnidary/BiGo_lar_M1_methylkit4_input.txt
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr + '_' + (cast (pos as varchar)) as chr_start, chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC, 1 - (cast (C_count as float) / cast (CT_count as float)) as freqT FROM [sr320@washington.edu].[BiGo_lar_T1D3] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -f tsv -o /Volumes/Monarch/cnidary/BiGo_lar_T1D3_methylkit4_input.txt
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr + '_' + (cast (pos as varchar)) as chr_start, chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC, 1 - (cast (C_count as float) / cast (CT_count as float)) as freqT FROM [sr320@washington.edu].[BiGo_lar_T1D5] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -f tsv -o /Volumes/Monarch/cnidary/BiGo_lar_T1D5_methylkit4_input.txt
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr + '_' + (cast (pos as varchar)) as chr_start, chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC, 1 - (cast (C_count as float) / cast (CT_count as float)) as freqT FROM [sr320@washington.edu].[BiGo_lar_M3] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -f tsv -o /Volumes/Monarch/cnidary/BiGo_lar_M3_methylkit4_input.txt
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr + '_' + (cast (pos as varchar)) as chr_start, chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC, 1 - (cast (C_count as float) / cast (CT_count as float)) as freqT FROM [sr320@washington.edu].[BiGo_lar_T3D3] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -f tsv -o /Volumes/Monarch/cnidary/BiGo_lar_T3D3_methylkit4_input.txt
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr + '_' + (cast (pos as varchar)) as chr_start, chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC, 1 - (cast (C_count as float) / cast (CT_count as float)) as freqT FROM [sr320@washington.edu].[BiGo_lar_T3D5] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -f tsv -o /Volumes/Monarch/cnidary/BiGo_lar_T3D5_methylkit4_input.txt
In excel and textwrangler made a list of non_redundant locis from all 6 files
Left Join in SQLshare on non_redundant ID
SELECT *
FROM [sr320@washington.edu].[_BiGo_lar_nonred_ID.txt]id
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_M1_hack]M1
ON id.[chr_start]=M1.[chr_start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr_start]=T1D3.[chr_start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T1D5_hack]T1D5
ON id.[chr_start]=T1D5.[chr_start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_M3_hack]M3
ON id.[chr_start]=M3.[chr_start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T3D3_hack]T3D3
ON id.[chr_start]=T3D3.[chr_start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T3D5_hack]T3D5
ON id.[chr_start]=T3D5.[chr_start]
python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -d "[sr320@washington.edu].[Snapshot of BiGo_Larvae_joineddata]" -o /Volumes/Monarch/cnidary/BiGo_lar_joineddata3.csv
Will try double column join ? as per Dan's Suggestion
SELECT *
FROM [sr320@washington.edu].[BiGo_lar_nonred_ID split]id
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_M1_hack]M1
ON id.[chr]=M1.[chr] AND id.[start]=M1.[start]
this worked fine..
SELECT *
FROM [sr320@washington.edu].[BiGo_lar_nonred_ID split]id
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_M1_hack]M1
ON id.[chr]=M1.[chr] AND id.[start]=M1.[start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T1D3_hack]T1D3
ON id.[chr]=T1D3.[chr] AND id.[start]=T1D3.[start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T1D5_hack]T1D5
ON id.[chr]=T1D5.[chr] AND id.[start]=T1D5.[start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_M3_hack]M3
ON id.[chr]=M3.[chr] AND id.[start]=M3.[start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T3D3_hack]T3D3
ON id.[chr]=T3D3.[chr] AND id.[start]=T3D3.[start]
LEFT JOIN [sr320@washington.edu].[_BiGo_lar_T3D5_hack]T3D5
ON id.[chr]=T3D5.[chr] AND id.[start]=T3D5.[start]
![im](files/img/BiGo_lar_joineddata.jpg)
/bin/sh: -c: line 0: syntax error near unexpected token `files/img/BiGo_lar_joineddata.jpg' /bin/sh: -c: line 0: `[im](files/img/BiGo_lar_joineddata.jpg)'
![pearl](files/img/pearl.jpeg)
/bin/sh: -c: line 0: syntax error near unexpected token `files/img/pearl.jpeg' /bin/sh: -c: line 0: `[pearl](files/img/pearl.jpeg)'
!head /Volumes/Monarch/cnidary/BiGo_lar_lociALL0.txt
chr start chr_start CountingCs SummingCs C16318 177 C16318_177 6 0 C16318 196 C16318_196 6 0 C16318 203 C16318_203 6 0 C16318 302 C16318_302 6 0 C19344 310 C19344_310 6 0 C19356 52 C19356_52 6 0 C19356 107 C19356_107 6 0 C19356 120 C19356_120 6 0 C19356 123 C19356_123 6 0
!wc /Volumes/Monarch/cnidary/BiGo_lar_lociALL0.txt
3230 16155 130260 /Volumes/Monarch/cnidary/BiGo_lar_lociALL0.txt
Up into SQLshare and generate file where loci covered by all 6 datasets and > 0 C_count
SELECT * FROM [sr320@washington.edu].[_BiGo_lar_joineddata_sums.csv]
where CountingCs = 6
and
SummingCs > 0
!head /Volumes/Monarch/cnidary/BiGo_lar_joineddata_mk.csv
chr start strand CT_count C_count freqC freqT
These files only contain loci covered in all 6 files and at least 1 mCpG
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_M1_methylkit6.txt
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T1D3_methylkit6.txt
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T1D5_methylkit6.txt
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_M3_methylkit6.txt
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T3D3_methylkit6.txt
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T3D5_methylkit6.txt
Quicklist old
M3
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_M3_methylkit.csv
T3D3
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T3D3_methylkit.csv
T3D5
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T3D5_methylkit.csv
M1
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_M1_methylkit.csv
T1D3
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T1D3_methylkit.csv
T1D5
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_T1D5_methylkit.csv
QC
M3
http://eagle.fish.washington.edu/cnidarian/BiGo_lar_M3_methylkit_oner.csv
BiGo(gonad)
http://eagle.fish.washington.edu/cnidarian/BiGO_betty_plain_methylkit.csv
!python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC FROM [sr320@washington.edu].[BiGO_betty_plain_methratio_v1.txt] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -o /Volumes/web/cnidarian/BiGO_betty_plain_methylkit_input.csv
!head /Volumes/web/cnidarian/BiGO_betty_plain_methylkit_input.csv
!tail -n +2 /Volumes/web/cnidarian/BiGO_betty_plain_methylkit_input.csv > /Volumes/web/cnidarian/BiGO_betty_plain_methylkit.csv
!head /Volumes/web/cnidarian/BiGO_betty_plain_methylkit.csv
SELECT
chr as chr,
pos as start,
'+' as strand,
cast (CT_count as float) as CT_count,
cast (C_count as float) as C_count
FROM [sr320@washington.edu].[BiGo_lar_M3]
where
context like '__CG_'
and
CT_Count >= 5
and
ratio <> 'NA'
SELECT
chr as chr,
start as start,
strand as strand,
CT_count as CT_count,
C_count as C_count,
C_count/CT_count as freqC
FROM [sr320@washington.edu].[_M3methylkit_s1]
SELECT
chr as chr,
start as start,
strand as strand,
CT_count as CT_count,
freqC as freqC
FROM [sr320@washington.edu].[_M3mehthykit_step2]
!head /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_input.csv
!tail -n +2 /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_input.csv > /Volumes/web/cnidarian/BiGo_lar_M3_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_M3_methylkit.csv
!wc /Volumes/web/cnidarian/BiGo_lar_M3_methylkit.csv
182475 182475 5044686 /Volumes/web/cnidarian/BiGo_lar_M3_methylkit.csv
#with one line of code...
!head /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_input_oner.csv
!tail -n +2 /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_input_oner.csv > /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_oner.csv
!head /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_oner.csv
!wc /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_oner.csv
182475 182475 5410598 /Volumes/web/cnidarian/BiGo_lar_M3_methylkit_oner.csv
!head /Volumes/web/cnidarian/BiGo_lar_T3D3_methylkit_input.csv
!tail -n +2 /Volumes/web/cnidarian/BiGo_lar_T3D3_methylkit_input.csv > /Volumes/web/cnidarian/BiGo_lar_T3D3_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_T3D3_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_T3D5_methylkit_input.csv
!tail -n +2 /Volumes/web/cnidarian/BiGo_lar_T3D5_methylkit_input.csv > /Volumes/web/cnidarian/BiGo_lar_T3D5_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_T3D5_methylkit.csv
FILE
/Volumes/web/cnidarian/BiGo_lar_T3D5_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_M1_methylkit_input.csv
!tail -n +2 /Volumes/web/cnidarian/BiGo_lar_M1_methylkit_input.csv > /Volumes/web/cnidarian/BiGo_lar_M1_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_M1_methylkit.csv
FILE
/Volumes/web/cnidarian/BiGo_lar_M1_methylkit.csv
!head /Volumes/web/cnidarian/BiGo_lar_T1D3_methylkit.csv
FILE
/Volumes/web/cnidarian/BiGo_lar_T1D3_methylkit.csv
python /Users/sr320/sqlshare-pythonclient/tools/fetchdata.py -s "SELECT chr as chr, pos as start, '+' as strand, cast (CT_count as float) as CT_count, cast (C_count as float) as C_count, cast (C_count as float) / cast (CT_count as float) as freqC FROM [sr320@washington.edu].[BiGo_lar_T1D5] where context like '__CG_' and CT_Count >= 5 and ratio <> 'NA'" -o /Volumes/web/cnidarian/BiGo_lar_T1D5_methylkit_input.csv
!head /Volumes/web/cnidarian/BiGo_lar_T1D5_methylkit.csv
FILE
/Volumes/web/cnidarian/BiGo_lar_T1D5_methylkit.csv