-----------------------
Need shift 5 command (have more than 9 arguments):
-----------------------
-----------------------
Start of variable list:
-----------------------
SCRIPT_DIR:
/unprotected/projects/waxmanlab/kkarri/G160_Samples/Scripts/09c_DiffExp_4_lncRNA_featureCounts
Dataset_DIR:
/restricted/projectnb/waxmanlab/kkarri/G160_Samples
Dataset_Label:
G160
ANNOTATION_FILE_DIR:
/unprotected/projects/waxmanlab/routines/GTF_Files
ANNOTATION_FILE:
/unprotected/projects/waxmanlab/routines/GTF_Files/ncRNA_output_filtered_final_gene.txt
CONDITION_1_NAME:
F_Nuclear
CONDITION_2_NAME:
M_Nuclear
Lengths_DIR:
/unprotected/projects/waxmanlab/routines/GTF_Files/lengths
GENE_LENGTHS_FILE:
intronic_only_gene_models_ncRNA_for_counting_lengths.txt
COUNT_DIR:
LncRNA_Intronic_Only_GTF
OUTPUT_PREFIX:
DiffExp_v2_LncRNA_Intronic_Only
DiffExp_Index:
DiffExp_4g
COL_SUFFIX:
LncRNA_Intronic_Only
COUNT_PROGRAM:
featureCounts
-----------------------
End of variable list
-----------------------
==========================================================
Starting on : Thu Aug 24 13:37:22 EDT 2017
Running on node : scc-wa1
Current directory : /restricted/projectnb/waxmanlab/kkarri/G160_Samples/Scripts/09c_DiffExp_4_lncRNA_featureCounts
Current job ID : 390598
Current job name : Step_09c_DiffExp_4g
Task index number : undefined
Parameter for multiple cores : 1
==========================================================

Change dir to scratch directory


Print scratch directory location:

/scratch/390598.1.w

Loading required modules...

------------------------------------------
Sample_DIR:
G160_M3
Sample_ID:
G160_M3
Description:
Female
M_Num:
M3
Copy Condition_1 sample count files to Condition_1 folder
Copy Condition_1 sample count summary files to Condition_1 folder
M_Num_Cond1_List:
M3
------------------------------------------
------------------------------------------
Sample_DIR:
G160_M5
Sample_ID:
G160_M5
Description:
Male
M_Num:
M5
Copy Condition_2 sample count files to Condition_2 folder
Copy Condition_2 sample count summary files to Condition_2 folder
M_Num_Cond2_List:
M5
------------------------------------------
==========================================================

Number of replicates in each condition:

NUM_REP_CONDITION1: 1
NUM_REP_CONDITION1: 1

WARNING:

Either your Condition_1 or Condition_2 has only 1 sample (no replicates)
The differential expression analysis is designed for cases where there are at least 2 replicates/biological condition.
The resulting differential expression analysis will be converted to a stringent version due to absence of replicate samples.
Samples from this comparison will be treated as "replicates" to estimate the gene level variance in edgeR and, separately in, DESeq2.
Expect very few to zero DE genes from DESeq2, EdgeR should yield a DE gene count.
Interpreting the results: use the edgeR fold change or DESeq ratio (not DESeq fold change)
Note regarding the SEGEX upload file(s):
Since DESeq2 fold changes are not the same as the ratio of the normalized counts between the conditions, so the output of the segex upload file will be different between "DESeq ratio" and "DESeq foldChange". The former is truly the ratio between the normalized counts between the two conditions (plus pseudocounts) whereas the latter is the fold change estimated by DESeq.
==========================================================

Renaming input count files

number of mapped reads (feature count summary)
Status	G160_M3_sorted.bam
Assigned	14760214
Unassigned_Ambiguity	524736
Unassigned_MultiMapping	0
Unassigned_NoFeatures	8499638
Unassigned_Unmapped	0
Unassigned_MappingQuality	0
Unassigned_FragmentLength	0
Unassigned_Chimera	0
Unassigned_Secondary	0
Unassigned_Nonjunction	0
Unassigned_Duplicate	0
Status	G160_M5_sorted.bam
Assigned	10266584
Unassigned_Ambiguity	402214
Unassigned_MultiMapping	0
Unassigned_NoFeatures	10603117
Unassigned_Unmapped	0
Unassigned_MappingQuality	0
Unassigned_FragmentLength	0
Unassigned_Chimera	0
Unassigned_Secondary	0
Unassigned_Nonjunction	0
Unassigned_Duplicate	0
==========================================================

List files in Input

-rw-r--r-- 1 kkarri pulmseq 359173 Aug 24 13:37 /scratch/390598.1.w/Input/F_Nuclear0.out
-rw-r--r-- 1 kkarri pulmseq    298 Aug 24 13:37 /scratch/390598.1.w/Input/F_Nuclear0.summary
-rw-r--r-- 1 kkarri pulmseq 355636 Aug 24 13:37 /scratch/390598.1.w/Input/M_Nuclear0.out
-rw-r--r-- 1 kkarri pulmseq    299 Aug 24 13:37 /scratch/390598.1.w/Input/M_Nuclear0.summary
-rw-r--r-- 1 kkarri pulmseq 414633 Aug 24 13:37 /scratch/390598.1.w/Input/intronic_only_gene_models_ncRNA_for_counting_lengths.txt

/scratch/390598.1.w/Input/F_Nuclear:
total 8
drwxr-xr-x 2 kkarri pulmseq 4096 Aug 24 13:37 .
drwxr-xr-x 4 kkarri pulmseq 4096 Aug 24 13:37 ..

/scratch/390598.1.w/Input/M_Nuclear:
total 8
drwxr-xr-x 2 kkarri pulmseq 4096 Aug 24 13:37 .
drwxr-xr-x 4 kkarri pulmseq 4096 Aug 24 13:37 ..
==========================================================

Starting to run my commands

Printing Rscript command:
Rscript differentialAnalysis.R F_Nuclear M_Nuclear 1 1 /unprotected/projects/waxmanlab/routines/GTF_Files/ncRNA_output_filtered_final_gene.txt /scratch/390598.1.w/Input DiffExp_v2_LncRNA_Intronic_Only intronic_only_gene_models_ncRNA_for_counting_lengths.txt
[1] "Arguments for differentialAnalysisDESeq.R:"
[1] "F_Nuclear"
[1] "M_Nuclear"
[1] 1
[1] 1
[1] "/unprotected/projects/waxmanlab/routines/GTF_Files/ncRNA_output_filtered_final_gene.txt"
[1] "/scratch/390598.1.w/Input"
[1] "DiffExp_v2_LncRNA_Intronic_Only"
[1] "intronic_only_gene_models_ncRNA_for_counting_lengths.txt"
==========================================================

Create SEGEX formatted file:

Printing Rscript command:
Rscript formatForSegex_ver3.R  DiffExp_v2_LncRNA_Intronic_Only_F_Nuclear_M_Nuclear.txt M_Nuclear_G160_M5_vs_F_Nuclear_G160_M3_DiffExp_v2_LncRNA_Intronic_Only_forSEGEXUpload 1 LncRNA_Intronic_Only
==========================================================
Comparison_Info:
M_Nuclear_G160_M5_F_Nuclear_G160_M3
#----------------------------------------------------------------------------------
Running Diff_Genes.R
#----------------------------------------------------------------------------------
Printing Rscript command:
Rscript Diff_Genes.R M_Nuclear_G160_M5_vs_F_Nuclear_G160_M3_DiffExp_v2_LncRNA_Intronic_Only_forSEGEXUpload_DESeq.txt 2 0.05 DESeq LncRNA_Intronic_Only'_'M_Nuclear_G160_M5_F_Nuclear_G160_M3
[1] "Print arguments:"
[1] "-----------------"
[1] "Differential expression_Output:"
[1] "M_Nuclear_G160_M5_vs_F_Nuclear_G160_M3_DiffExp_v2_LncRNA_Intronic_Only_forSEGEXUpload_DESeq.txt"
[1] "fold_change_cutoff:"
[1] "2"
[1] "padj_cutoff:"
[1] "0.05"
[1] "postfix:"
[1] "DESeq"
[1] "count_method:"
[1] "LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3"
[1] "-----------------"
[1] "DESeq or EdgeR job most likely failed."
[1] "Quitting R now."
Rscript Diff_Genes.R M_Nuclear_G160_M5_vs_F_Nuclear_G160_M3_DiffExp_v2_LncRNA_Intronic_Only_forSEGEXUpload_EdgeR.txt 2 0.05 EdgeR LncRNA_Intronic_Only'_'M_Nuclear_G160_M5_F_Nuclear_G160_M3
[1] "Print arguments:"
[1] "-----------------"
[1] "Differential expression_Output:"
[1] "M_Nuclear_G160_M5_vs_F_Nuclear_G160_M3_DiffExp_v2_LncRNA_Intronic_Only_forSEGEXUpload_EdgeR.txt"
[1] "fold_change_cutoff:"
[1] "2"
[1] "padj_cutoff:"
[1] "0.05"
[1] "postfix:"
[1] "EdgeR"
[1] "count_method:"
[1] "LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3"
[1] "-----------------"
[1] "DESeq or EdgeR job most likely failed."
[1] "Quitting R now."
#----------------------------------------------------------------------------------
Running Venn_Diff_Genes.R
#----------------------------------------------------------------------------------
Printing Rscript command:
#----------------------------------------------------------------------------------
Rscript Venn_Diff_Genes.R Down_Genes_DESeq_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt Down_Genes_EdgeR_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt LncRNA_Intronic_Only_Counting DiffExp_4g
[1] "Print arguments:"
[1] "-----------------"
[1] "File1:"
[1] "Down_Genes_DESeq_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt"
[1] "File2:"
[1] "Down_Genes_EdgeR_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt"
[1] "Subtitle:"
[1] "LncRNA_Intronic_Only_Counting"
[1] "DiffExp_Index:"
[1] "DiffExp_4g"
[1] "-----------------"
#----------------------------------------------------------------------------------
Rscript Venn_Diff_Genes.R Up_Genes_DESeq_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt Up_Genes_EdgeR_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt LncRNA_Intronic_Only_Counting DiffExp_4g
[1] "Print arguments:"
[1] "-----------------"
[1] "File1:"
[1] "Up_Genes_DESeq_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt"
[1] "File2:"
[1] "Up_Genes_EdgeR_LncRNA_Intronic_Only_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt"
[1] "Subtitle:"
[1] "LncRNA_Intronic_Only_Counting"
[1] "DiffExp_Index:"
[1] "DiffExp_4g"
[1] "-----------------"
#----------------------------------------------------------------------------------
#----------------------------------------------------------------------------------
Merging Count.Table(s) into one text file
#----------------------------------------------------------------------------------
Comparison_Info:
M_Nuclear_G160_M5_F_Nuclear_G160_M3
#----------------------------------------------------------------------------------
==========================================================
Renaming the Differential_Expression_File
==========================================================

List files in Input

-rw-r--r-- 1 kkarri pulmseq      0 Aug 24 13:37 /scratch/390598.1.w/Input/DiffExp_4g_Venn_Tables_M_Nuclear_G160_M5_F_Nuclear_G160_M3.txt
-rwxr-xr-x 1 kkarri pulmseq   7706 Aug 24 13:37 /scratch/390598.1.w/Input/Diff_Genes.R
-rw-r--r-- 1 kkarri pulmseq 359173 Aug 24 13:37 /scratch/390598.1.w/Input/F_Nuclear0.out
-rw-r--r-- 1 kkarri pulmseq    298 Aug 24 13:37 /scratch/390598.1.w/Input/F_Nuclear0.summary
-rw-r--r-- 1 kkarri pulmseq 355636 Aug 24 13:37 /scratch/390598.1.w/Input/M_Nuclear0.out
-rw-r--r-- 1 kkarri pulmseq    299 Aug 24 13:37 /scratch/390598.1.w/Input/M_Nuclear0.summary
-rwxr-xr-x 1 kkarri pulmseq   9993 Aug 24 13:37 /scratch/390598.1.w/Input/Venn_Diff_Genes.R
-rwxr-xr-x 1 kkarri pulmseq   4968 Aug 24 13:37 /scratch/390598.1.w/Input/formatForSegex_ver3.R
-rw-r--r-- 1 kkarri pulmseq 414633 Aug 24 13:37 /scratch/390598.1.w/Input/intronic_only_gene_models_ncRNA_for_counting_lengths.txt

/scratch/390598.1.w/Input/F_Nuclear:
total 8
drwxr-xr-x 2 kkarri pulmseq 4096 Aug 24 13:37 .
drwxr-xr-x 4 kkarri pulmseq 4096 Aug 24 13:37 ..

/scratch/390598.1.w/Input/M_Nuclear:
total 8
drwxr-xr-x 2 kkarri pulmseq 4096 Aug 24 13:37 .
drwxr-xr-x 4 kkarri pulmseq 4096 Aug 24 13:37 ..
==========================================================

List files in scratch

total 3.4M
drwxr-xr-x   3 kkarri pulmseq 4.0K Aug 24 13:37 .
drwxrwxrwt. 47 root   root     24K Aug 24 13:37 ..
-rw-r--r--   1 kkarri pulmseq   56 Aug 24 13:37 Condition_1.txt
-rw-r--r--   1 kkarri pulmseq   54 Aug 24 13:37 Condition_2.txt
drwxr-xr-x   4 kkarri pulmseq 4.0K Aug 24 13:37 Input
-rwxr-xr-x   1 kkarri pulmseq  13K Aug 24 13:37 differentialAnalysis.R
-rw-r--r--   1 kkarri pulmseq 3.3M Aug 24 13:37 ncRNA_output_filtered_final_gene.txt

==========================================================
Re-naming files in OUTPUT_DIR
Need to append the COUNT_PROGRAM name to all output files

List files in OUTPUT_DIR

total 32K
drwxr-sr-x 2 kkarri waxmanlab 512 Aug 24 13:37 .
drwxr-sr-x 7 kkarri waxmanlab 32K Aug 24 13:37 ..
-rw-r--r-- 1 kkarri waxmanlab   0 Aug 24 13:37 DiffExp_4g_Venn_Tables_M_Nuclear_G160_M5_F_Nuclear_G160_M3_featureCounts.txt
==========================================================
==========================================================
Finished on : Thu Aug 24 13:37:37 EDT 2017
0 minutes and 15 seconds elapsed.
==========================================================
