statistics~DESeq2

DESeq2 analysis

input_1:count table

input_1/fin.qiu.genes.count_table

gene_id	0010_1.fastq	0012_1.fastq	0014_1.fastq	0015_1.fastq	0016_1.fastq	0017_1.fastq	0021_1.fastq	0024_1.fastq	0025_1.fastq	0026_1.fastq	0032_1.fastq	0035_1.fastq	0041_1.fastq	0042_1.fastq	0046_1.fastq	0050_1.fastq	0063_1.fastq	0066_1.fastq	0067_1.fastq	0069_1.fastq	0073_1.fastq	0074_1.fastq	0080_1.fastq	0081_1.fastq	0083_1.fastq	0085_1.fastq	0086_1.fastq	0087_1.fastq	0088_1.fastq	0089_1.fastq	0094_1.fastq	0095_1.fastq	0096_1.fastq	0097_1.fastq	0098_1.fastq	0102_1.fastq	0103_1.fastq	0104_1.fastq	9250_1.fastq	9303_1.fastq	fin8220_1.fastq	fin8241_1.fastq
MSTRG.34956	0	0	1.67825	0.841872	0.51571	0	0	0	0	0	1.19179	0	0	0	0	0	2.22818	0	0	0	0	0	0	0	0	0	0	0	0	0	0	2.58743	0	0	0	0	2.16523	0	0	0	0	0
MSTRG.33635	0.8125	0	0	0	0.952206	0	1.02941	0.084559	0	0.555147	1.14016	0.371324	0	1.03676	2.20588	0.503676	0	0.055147	1.52941	0	0	0	0	5.45221	0	0.191176	0	0	0.088235	0	0	0.058824	0	0.966912	0	0.669118	1.57721	2.61029	0	0	0	0
MSTRG.34957	0	0.349481	0	0	0	0	0	0	0	0	0	0	0	0	0	0.279123	0.920415	0	0	0	0	0	0	0.179931	0	0	0	0	0	0	0	0	0	0.219723	3.35294	0	0	0	0	0	0	0
MSTRG.33636	0.517241	0	0	0	0	0.52069	0	0.517241	0	0	1.47759	0.517241	0	0.510345	0.455172	0.496552	0	0	1.53965	0	0.255172	0	0	0	0	0	0.512069	0	0	0	0	0	0.194828	0.437931	0.025862	0.517241	1.23104	1.06724	0.225862	0	1.13597	0.218966
MSTRG.34958	0.476948	0	0	0	0	0.91256	0.329094	0	0	0	0	0.45151	0.45787	0	0	0.952305	0.839428	0.403816	1.8601	0	0.235294	0.475358	0	0.470588	0	0.146264	0.440382	0	0.699523	2.12719	0.236884	0.267091	0.620032	0.915739	0	0.406995	0.91097	0.244833	1.37997	0	0.922099	0
MSTRG.33637	8.76232	14.7562	7.40916	15.2814	11.9498	7.58117	5.27547	19.5882	8.16143	4.63251	9.4	6.13842	7.48348	11.8151	6.73134	13.8355	13.1805	7.16488	12.4116	4.40255	4.95846	11.1834	7.56257	11.8422	7.06995	10.0331	9.8606	9.28109	8.04729	13.3893	7.5768	4.89631	6.78818	10.9112	8.54253	11.2956	9.72315	8.13215	12.1456	5.36823	10.9889	10.7606
MSTRG.34959	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
MSTRG.33638	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1.37895	0	0	1.42749	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
MSTRG.32000	48.3219	56.5226	38.3145	67.8422	73.1224	32.1719	49.1824	88.3027	37.3264	36.0939	50.4939	52.2885	52.2132	52.5532	36.7729	85.1511	37.2282	54.4083	56.4022	23.0667	18.1345	59.9655	50.6956	72.1771	40.3438	38.1944	59.5931	33.2765	42.9829	91.9969	61.339	40.5121	51.9577	67.4603	50.278	67.3721	50.8645	36.9446	62.7158	34.0289	49.6916	33.7935

input_2:sample list

input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt

id	condition
0010_1.fastq	male_short
0016_1.fastq	female_short
0021_1.fastq	female_long
0024_1.fastq	male_long
0032_1.fastq	male_long
0035_1.fastq	female_short
0050_1.fastq	female_short
0063_1.fastq	female_short
0069_1.fastq	male_long

input_2/Qiu.fin2.txt

id	condition
0010_1.fastq.gz	male_short
0016_1.fastq.gz	female_short
0021_1.fastq.gz	female_long
0024_1.fastq.gz	male_long
0032_1.fastq.gz	male_long
0035_1.fastq.gz	female_short
0050_1.fastq.gz	female_short
0063_1.fastq.gz	female_short
0069_1.fastq.gz	male_long

input_3:Trinotate added count table

Command

statistics~DESeq2 -c 8 -m 32 input_1/fin.qiu.genes.count_table input_2/Qiu.fin2.txt

Output

fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.scatter.png

view all outputs

Log

pp statistics~DESeq2 -c 8 -m 32 input_1/fin.qiu.genes.count_table input_2/Qiu.fin2.txt
Checking the realpath of input files.
0 input_1/fin.qiu.genes.count_table
0 input_2/Qiu.fin2.txt
0 
/home/yoshitake.kazutoshi/work -> /data/yoshitake.kazutoshi/work
/home/yoshitake.kazutoshi/work/pp-dev -> /data/yoshitake.kazutoshi/work/pp-dev
/home/yoshitake.kazutoshi/work/pp-dev/yoshitake -> /data/yoshitake.kazutoshi/work/pp-dev/yoshitake
/home/yoshitake.kazutoshi/work/pp-dev/yoshitake/test -> /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test
/home/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -> /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2
/data/yoshitake.kazutoshi/work
/data/yoshitake.kazutoshi/work/pp-dev
/data/yoshitake.kazutoshi/work/pp-dev/yoshitake
/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test
/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2
script: /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/PortablePipeline/PortablePipeline/scripts/statistics~DESeq2 "$scriptdir"/statistics~scatter_with_variance
c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 centos:centos6
using docker
++ docker pull c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4: Pulling from c2997108/centos7
8ba884070f61: Pulling fs layer
90629ce61298: Pulling fs layer
251dfbb6a15d: Pulling fs layer
e3d92a7f13dc: Pulling fs layer
e768b701dfbb: Pulling fs layer
4cc4525b8a1e: Pulling fs layer
439be8403c2c: Pulling fs layer
7ee91115c79b: Pulling fs layer
ab97148a63e3: Pulling fs layer
e3d92a7f13dc: Waiting
e768b701dfbb: Waiting
04a623cfc77d: Pulling fs layer
4cc4525b8a1e: Waiting
ab97148a63e3: Waiting
04a623cfc77d: Waiting
7ee91115c79b: Waiting
439be8403c2c: Waiting
8ba884070f61: Verifying Checksum
8ba884070f61: Download complete
e3d92a7f13dc: Verifying Checksum
e3d92a7f13dc: Download complete
e768b701dfbb: Verifying Checksum
e768b701dfbb: Download complete
4cc4525b8a1e: Download complete
439be8403c2c: Verifying Checksum
439be8403c2c: Download complete
7ee91115c79b: Verifying Checksum
7ee91115c79b: Download complete
ab97148a63e3: Verifying Checksum
ab97148a63e3: Download complete
04a623cfc77d: Verifying Checksum
04a623cfc77d: Download complete
8ba884070f61: Pull complete
251dfbb6a15d: Verifying Checksum
251dfbb6a15d: Download complete
90629ce61298: Verifying Checksum
90629ce61298: Download complete
90629ce61298: Pull complete
251dfbb6a15d: Pull complete
e3d92a7f13dc: Pull complete
e768b701dfbb: Pull complete
4cc4525b8a1e: Pull complete
439be8403c2c: Pull complete
7ee91115c79b: Pull complete
ab97148a63e3: Pull complete
04a623cfc77d: Pull complete
Digest: sha256:0d79ccb1e305397c9ad1ad7681a1f8992250f53aaef963aba53490e9b0916eaf
Status: Downloaded newer image for c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
docker.io/c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
++ set +ex
++ docker pull centos:centos6
centos6: Pulling from library/centos
ff50d722b382: Pulling fs layer
ff50d722b382: Verifying Checksum
ff50d722b382: Download complete
ff50d722b382: Pull complete
Digest: sha256:a93df2e96e07f56ea48f215425c6f1673ab922927894595bb5c0ee4c5a955133
Status: Downloaded newer image for centos:centos6
docker.io/library/centos:centos6
++ set +ex
+ set -o pipefail
+ script=run-DESeq2.R
+ inputmatrix=input_1/fin.qiu.genes.count_table
+ sed 's/\r//g'
+ cat input_2/Qiu.fin2.txt
+ sed '/^$/d'
+ sed 's/ \+/\t/g; s/\t\+/\t/g; s/\t\+$//; s/[.]gz\t/\t/'
+ awk '-F\t' '{gsub(/[^A-Za-z0-9._\t-]/,"_",$0); print $0}'
++ basename input_1/fin.qiu.genes.count_table
++ basename input_1/fin.qiu.genes.count_table
+ inputsamplematrix=input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
+ g1=
+ g2=
+ '[' '' = '' ']'
++ tail -n+2 input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
++ uniq
++ head -n 1
++ cut -f 2
++ sort -V
+ g1=female_long
+ '[' '' = '' ']'
++ head -n 2
++ uniq
++ sort -V
++ cut -f 2
++ tail -n 1
++ tail -n+2 input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
+ g2=female_short
+ p=0.05
++ basename input_1/fin.qiu.genes.count_table
+ outputfile=DESeq2.fin.qiu.genes.count_table
++ basename input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
++ basename input_1/fin.qiu.genes.count_table
+ samplex=DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.x
++ basename input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
++ basename input_1/fin.qiu.genes.count_table
+ sampley=DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.y
++ basename input_1/fin.qiu.genes.count_table
+ outputfilexup=result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt
++ basename input_1/fin.qiu.genes.count_table
+ outputfileyup=result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt
+ '[' '' = '' ']'
+ annotationfile=input_1/fin.qiu.genes.count_table
+ cat
+ FUNC_RUN_DOCKER c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 R --vanilla
+ PP_RUN_IMAGE=c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
+ shift
+ PP_RUN_DOCKER_CMD=("${@}")
++ date +%Y%m%d_%H%M%S_%3N
+ PPDOCNAME=pp20230907_180338_846_30620
+ echo pp20230907_180338_846_30620
++ id -u
++ id -g
+ docker run --name pp20230907_180338_846_30620 -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -w /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -v /data/yoshitake.kazutoshi/work:/data/yoshitake.kazutoshi/work -v /data/yoshitake.kazutoshi/work/pp-dev:/data/yoshitake.kazutoshi/work/pp-dev -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -u 2007:600 -i --rm c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 R --vanilla

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DESeq2)
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min


Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: DelayedArray
Loading required package: matrixStats

Attaching package: 'matrixStats'

The following objects are masked from 'package:Biobase':

    anyMissing, rowMedians

Loading required package: BiocParallel

Attaching package: 'DelayedArray'

The following objects are masked from 'package:matrixStats':

    colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges

The following objects are masked from 'package:base':

    aperm, apply

> colData <- read.table("input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt", header=T, row.names=1, sep="\t")
> countData=round(read.table("input_1/fin.qiu.genes.count_table",sep="\t",header=T,row.names=1))
> mydata=data.frame("group"=as.character(colData[,1]),stringsAsFactors=F)
> dds <- DESeqDataSetFromMatrix(countData = countData, colData = mydata, design = ~ group)
Error in DESeqDataSetFromMatrix(countData = countData, colData = mydata,  : 
  ncol(countData) == nrow(colData) is not TRUE
Calls: DESeqDataSetFromMatrix -> stopifnot
Execution halted
+ true
+ '[' '!' -e DESeq2.fin.qiu.genes.count_table ']'
+ touch DESeq2.fin.qiu.genes.count_table
+ cut -f 1
+ tail -n+2 DESeq2.fin.qiu.genes.count_table
+ awk '-F\t' -v g1=female_long '$2==g1{print $1}' input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
+ awk '-F\t' -v g2=female_short '$2==g2{print $1}' input_2/Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt
+ bash /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/PortablePipeline/PortablePipeline/scripts/statistics~scatter_with_variance -x female_long -y female_short input_1/fin.qiu.genes.count_table DESeq2.fin.qiu.genes.count_table.id DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.x DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.y
Checking the realpath of input files.
0 input_1/fin.qiu.genes.count_table
0 DESeq2.fin.qiu.genes.count_table.id
0 DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.x
0 DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.y
c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 centos:centos6
using docker
+ set -o pipefail
+ countmat=input_1/fin.qiu.genes.count_table
+ sigmat=DESeq2.fin.qiu.genes.count_table.id
+ listx=DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.x
+ listy=DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.y
+ label_x=female_long
+ label_y=female_short
+ p=0.05
++ basename input_1/fin.qiu.genes.count_table
++ basename DESeq2.fin.qiu.genes.count_table.id
+ output=fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id
+ cat input_1/fin.qiu.genes.count_table
+ awk '-F\t' 'FILENAME==ARGV[1]{if(FNR>1){for(i=2;i<=NF;i++){a[i]+=$i}}} FILENAME==ARGV[2]{if(FNR==1){print $0}else{ORS=""; print $1;for(i=2;i<=NF;i++){print "\t"$i/a[i]*1000*1000}; print "\n"}}' /dev/stdin input_1/fin.qiu.genes.count_table
+ cat DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.x
+ awk '-F\t' 'FILENAME==ARGV[1]{a[$1]=1} FILENAME==ARGV[2]{if(FNR==1){for(i=1;i<=NF;i++){if(a[$i]==1){b[i]=1}}}; ORS=""; print $1; for(i=2;i<=NF;i++){if(b[i]==1){print "\t"$i}}; print "\n"}' /dev/stdin fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm
+ cat DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.y
+ awk '-F\t' 'FILENAME==ARGV[1]{a[$1]=1} FILENAME==ARGV[2]{if(FNR==1){for(i=1;i<=NF;i++){if(a[$i]==1){b[i]=1}}}; ORS=""; print $1; for(i=2;i<=NF;i++){if(b[i]==1){print "\t"$i}}; print "\n"}' /dev/stdin fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm
+ cat DESeq2.fin.qiu.genes.count_table.id
+ awk '-F\t' 'FILENAME==ARGV[1]{a[$1]=1} FILENAME==ARGV[2] && (FNR==1 || a[$1]==1){print $0}' /dev/stdin fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_x
+ cat DESeq2.fin.qiu.genes.count_table.id
+ awk '-F\t' 'FILENAME==ARGV[1]{a[$1]=1} FILENAME==ARGV[2] && (FNR==1 || a[$1]==1){print $0}' /dev/stdin fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_y
+ cat
+ FUNC_RUN_DOCKER c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 R --vanilla
+ PP_RUN_IMAGE=c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
+ shift
+ PP_RUN_DOCKER_CMD=("${@}")
++ date +%Y%m%d_%H%M%S_%3N
+ PPDOCNAME=pp20230907_180403_481_4622
+ echo pp20230907_180403_481_4622
++ id -u
++ id -g
+ docker run --name pp20230907_180403_481_4622 -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -w /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -u 2007:600 -i --rm c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 R --vanilla

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 
> label_x="female_long"
> label_y="female_short"
> file_data_x="fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_x"
> file_data_y="fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_y"
> file_sig_data_x="fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_x_sig"
> file_sig_data_y="fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_y_sig"
> data_x=round(read.table(file_data_x,sep="\t",header=T,row.names=1))
> data_y=round(read.table(file_data_y,sep="\t",header=T,row.names=1))
> sig_data_x=read.table(file_sig_data_x,sep="\t",header=T,row.names=1)
> if(dim(sig_data_x)[1]!=0){sig_data_x=round(sig_data_x)}
> sig_data_y=read.table(file_sig_data_y,sep="\t",header=T,row.names=1)
> if(dim(sig_data_y)[1]!=0){sig_data_y=round(sig_data_y)}
> mean_data_x=apply(data_x,1,mean)
> mean_data_y=apply(data_y,1,mean)
> if(dim(data_x)[2]>1){
+  dx=apply(data_x,1,function(i){return(abs(qt(0.05/2, length(i)-1)) * sd(i) / sqrt(length(i)))})
+ }else{
+  dx=0
+ }
> if(dim(data_y)[2]>1){
+  dy=apply(data_y,1,function(i){return(abs(qt(0.05/2, length(i)-1)) * sd(i) / sqrt(length(i)))})
+ }else{
+  dy=0
+ }
> vx=dx/mean_data_x
> vy=dy/mean_data_y
> vx[is.na(vx)]=0
> vy[is.na(vy)]=0
> #total_var_data=sqrt(dx^2+dy^2)/sqrt(mean_data_x^2+mean_data_y^2)
> #total_var_data[is.na(total_var_data)]=0
> total_var_data=sqrt(vx^2+vy^2)
> mean_sig_data_x=apply(sig_data_x,1,mean)
> mean_sig_data_y=apply(sig_data_y,1,mean)
> min_x=min(mean_data_x[mean_data_x>0])/10
> min_y=min(mean_data_y[mean_data_y>0])/10
> plot_mean_data_x=mean_data_x+min_x
> plot_mean_data_y=mean_data_y+min_y
> plot_mean_sig_data_x=mean_sig_data_x+min_x
> plot_mean_sig_data_y=mean_sig_data_y+min_y
> max_x=max(plot_mean_data_x)
> max_y=max(plot_mean_data_y)
> library(Cairo)
> mainplotfunc=function(){
+ if(max(dx,dy)>0){
+  start_class=quantile(total_var_data[total_var_data>0],c(0,1,25,50,75,90,100)/100)[2]
+  end_class=quantile(total_var_data[total_var_data>0],c(0,1,25,50,75,90,100)/100)[6]
+ 
+  CairoPNG("fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.scatter.png",width=800,height=600)
+  num_class=22
+  library(RColorBrewer)
+  #mycol=colorRampPalette(c(rgb(0.5,0,0.2,0.4),rgb(1,0.8,0.7,1)), alpha=TRUE)(num_class)
+  colPal3 <- colorRampPalette(brewer.pal(9,"YlOrRd")[3:9])
+  mycol=colPal3(num_class)
+ 
+  layout(matrix(c(1,1,1,1,2),1,5))
+  par(ps = 18)
+  k=0
+  i=end_class
+  n=(total_var_data>=i)
+  xt=plot_mean_data_x[n]
+  yt=plot_mean_data_y[n]
+  plot(xt,yt,log="xy",xlim=c(min_x,max_x),ylim=c(min_y,max_y),cex=2*(k+1)^3/num_class^3,pch=21,col=adjustcolor(mycol[k+1],0),bg=adjustcolor(mycol[k+1],1-0.4*k/num_class),xlab=label_x,ylab=label_y)
+ 
+  for(k in 1:(num_class-2)){
+   i=end_class+(start_class-end_class)*k/(num_class-2)
+   n=(total_var_data>=i & total_var_data=i & total_var_data=",i),pos=4)
+  }
+  k=num_class-1
+  i=min(total_var_data)
+  par(new=T)
+  plot(c(0),c(k),xlim=c(0,0),ylim=c(-1,num_class),col=adjustcolor(mycol[k+1],0),bg=adjustcolor(mycol[k+1],1-0.4*k/num_class),pch=21,cex=2*(k+1)^3/num_class^3,bty="n",axes=F,xlab="",ylab="")
+  text(c(0.05),c(k),paste(">=",i),pos=4)
+  text(0,num_class+0.2,"95%conf/mean")
+  par(new=T)
+  plot(c(-0.3),c(-1),xlim=c(0,0),ylim=c(-1,num_class),col="green",cex=1,bty="n",axes=F,xlab="",ylab="")
+  text(c(-0.3),c(-1),paste("significant"),pos=4)
+ 
+  dev.off()
+ }
+ }
> subplotfunc=function(){
+ CairoPNG("fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.scatter.normal.png",width=600,height=600)
+ plot(plot_mean_data_x,plot_mean_data_y,log="xy",xlim=c(min_x,max_x),ylim=c(min_y,max_y),cex=0.1,pch=21,col=adjustcolor("#000000",0.5),xlab=label_x,ylab=label_y)
+ par(new=T)
+ plot(plot_mean_sig_data_x,plot_mean_sig_data_y,log="xy",xlim=c(min_x,max_x),ylim=c(min_y,max_y),col="green",cex=2,axes=F,xlab="",ylab="")
+ dev.off()
+ }
> 
> wflag=0
> while(wflag<=5){
+  restry=NULL
+  restry=try(mainplotfunc(), silent = FALSE)
+  if(class(restry)!="try-error"){break}
+  try(dev.off())
+  Sys.sleep(10+runif(1, min=0,max=100)/10)
+  wflag=wflag+1
+ }
> wflag=0
> while(wflag<=5){
+  restry=NULL
+  restry=try(subplotfunc(), silent = FALSE)
+  if(class(restry)!="try-error"){break}
+  try(dev.off())
+  Sys.sleep(10+runif(1, min=0,max=100)/10)
+  wflag=wflag+1
+ }
> 
> 
> 
+ rm -f fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_x fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_y fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_x_sig fin.qiu.genes.count_table.DESeq2.fin.qiu.genes.count_table.id.cpm_y_sig
+ post_processing
+ '[' 2 = 1 ']'
+ exit
+ awk '{if($3>=0){print $1"\tx"}else{print $1"\ty"}}'
+ tail -n+2 DESeq2.fin.qiu.genes.count_table
+ cut -f 1,7
+ awk '-F\t' 'NR==1{print -1"\t"$0} NR>1{print $2"\t"$0}'
+ cut -f 2-
+ awk '-F\t' 'NR==1{print "id\t"$0} NR>1{print $0}' DESeq2.fin.qiu.genes.count_table
+ sort -k1,1g
+ awk '-F\t' 'FILENAME==ARGV[1]{xy[$1]=$2} FILENAME==ARGV[2]{if(FNR==1){header=$0}; res[$1]=$0} FILENAME==ARGV[3]{if(FNR==1){print header"\t"$2}else{if(xy[$1]=="x"){print res[$1]"\t"$2}}}' DESeq2.fin.qiu.genes.count_table.xy input_1/fin.qiu.genes.count_table DESeq2.fin.qiu.genes.count_table.p
+ awk '-F\t' 'FILENAME==ARGV[1]{xy[$1]=$2} FILENAME==ARGV[2]{if(FNR==1){header=$0}; res[$1]=$0} FILENAME==ARGV[3]{if(FNR==1){print header"\t"$2}else{if(xy[$1]=="y"){print res[$1]"\t"$2}}}' DESeq2.fin.qiu.genes.count_table.xy input_1/fin.qiu.genes.count_table DESeq2.fin.qiu.genes.count_table.p
+ i=result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt
+ sed 's/\t$//'
+ awk '-F\t' -v maxlen=30000 'FILENAME==ARGV[1]{for(i=1;i<=NF;i++){n=int((length($i)-1)/maxlen)+1; if(n>a[i]){a[i]=n}}} FILENAME==ARGV[2]{if(FNR==1){ORS=""; for(i=1;i<=NF;i++){if(a[i]<=1){print $i"\t"}else{for(j=1;j<=a[i];j++){print $i" (split "j")\t"}}}; print "\n"}else{for(i=1;i<=NF;i++){if(a[i]<=1){print $i"\t"}else{for(j=1;j<=a[i];j++){print substr($i,(j-1)*maxlen+1,maxlen)"\t" }}}; print "\n"}}' result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt ./result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt
+ i=result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt
+ sed 's/\t$//'
+ awk '-F\t' -v maxlen=30000 'FILENAME==ARGV[1]{for(i=1;i<=NF;i++){n=int((length($i)-1)/maxlen)+1; if(n>a[i]){a[i]=n}}} FILENAME==ARGV[2]{if(FNR==1){ORS=""; for(i=1;i<=NF;i++){if(a[i]<=1){print $i"\t"}else{for(j=1;j<=a[i];j++){print $i" (split "j")\t"}}}; print "\n"}else{for(i=1;i<=NF;i++){if(a[i]<=1){print $i"\t"}else{for(j=1;j<=a[i];j++){print substr($i,(j-1)*maxlen+1,maxlen)"\t" }}}; print "\n"}}' result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt ./result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt
+ FUNC_RUN_DOCKER c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 java -Xmx1G -jar /usr/local/bin/excel2.jar result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt.temp result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt.xlsx
+ PP_RUN_IMAGE=c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
+ shift
+ PP_RUN_DOCKER_CMD=("${@}")
++ date +%Y%m%d_%H%M%S_%3N
+ PPDOCNAME=pp20230907_180413_500_18880
+ echo pp20230907_180413_500_18880
++ id -u
++ id -g
+ docker run --name pp20230907_180413_500_18880 -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -w /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -v /data/yoshitake.kazutoshi/work:/data/yoshitake.kazutoshi/work -v /data/yoshitake.kazutoshi/work/pp-dev:/data/yoshitake.kazutoshi/work/pp-dev -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -u 2007:600 -i --rm c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 java -Xmx1G -jar /usr/local/bin/excel2.jar result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt.temp result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt.xlsx
Start converting
+ FUNC_RUN_DOCKER c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 java -Xmx1G -jar /usr/local/bin/excel2.jar result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt.temp result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt.xlsx
+ PP_RUN_IMAGE=c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4
+ shift
+ PP_RUN_DOCKER_CMD=("${@}")
++ date +%Y%m%d_%H%M%S_%3N
+ PPDOCNAME=pp20230907_180418_188_26741
+ echo pp20230907_180418_188_26741
++ id -u
++ id -g
+ docker run --name pp20230907_180418_188_26741 -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -w /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -v /data/yoshitake.kazutoshi/work:/data/yoshitake.kazutoshi/work -v /data/yoshitake.kazutoshi/work/pp-dev:/data/yoshitake.kazutoshi/work/pp-dev -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test -v /data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2:/data/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2 -u 2007:600 -i --rm c2997108/centos7:1-trinity_2.8.5-kallisto_0.46.0-blast_2.9.0-trinotate-3.1.1-R_4-kegg_4 java -Xmx1G -jar /usr/local/bin/excel2.jar result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt.temp result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt.xlsx
Start converting
+ rm -f DESeq2.fin.qiu.genes.count_table.id DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.x DESeq2.Qiu.fin2.txt.fin.qiu.genes.count_table.DESeq2.txt.fin.qiu.genes.count_table.y DESeq2.fin.qiu.genes.count_table.xy DESeq2.fin.qiu.genes.count_table.p result.DESeq2.fin.qiu.genes.count_table.female_long.up.female_short.down.txt.temp result.DESeq2.fin.qiu.genes.count_table.female_long.down.female_short.up.txt.temp
+ post_processing
+ '[' 1 = 1 ']'
+ rm -f /home/yoshitake.kazutoshi/work/pp-dev/yoshitake/test/statistics~DESeq2/pp-singularity-flag
+ '[' '' = y ']'
+ echo 0
+ exit
PID: 1623255