------PisaR v1.6 miRNA profiling workflow------
# make a "sampleOrder" file to control what order of samples you want to summarize
# also use "sampleOrder" file to control which samples (could be one) you want to summarize
# an example for sample order file:
1	CCACTC_4
2	AAGCTA_3
3	AAGCTA_7
# if no sample order file provided, samples will be ordered by alphabet
# run the following programs one by one:

# run for all samples by using single assignment approach or multiple assignment approach
matchAllSamples_miR.pl --singleAssign
or
matchAllSamples_miR.pl --multiAssign
sumDist.pl sampleOrder
sumRate.pl sampleOrder

# summarize features
sumFeature.pl sampleOrder
sumMatchID_miR.pl all_sample.feature --FW --mis_0 --mirID --weightMismatch
sumMatchID_miR.pl all_sample.feature --FW --mis_1 --mirID --weightMismatch
sumMatchID_miR.pl all_sample.feature --FW --mis_2 --mirID --weightMismatch
sumMatchID_miR.pl all_sample.feature --FW --mis_3 --mirID --weightMismatch
sumDist_miR_v1.7.pl sampleOrder  --FW --mis_1 --noEnd
cd Dist_miR_mis_1+
verifyDist_miR.pl

# summarize profile
sumProfile_v1.6w.pl sampleOrder
divideMatchType.pl all_sample.profile

# summarize mismatch
sumMismatch_offset.pl all_sample.human_miRNA.mis_1+.profile --unweightedCount
or
sumMismatch_offset.pl all_sample.human_miRNA_all.mis_1+.profile --weightedCount

------PisaR v1.6.3 standard workflow------
# make a "sampleOrder" file to control what order of samples you want to summarize
# also use "sampleOrder" file to control which samples (could be one) you want to summarize
# an example for sample order file:
1	CCACTC_4
2	AAGCTA_3
3	AAGCTA_7
# if no sample order file provided, samples will be ordered by alphabet
# run the following programs one by one:

# preprocess
preprocess_TK.py
preprocess_SE.pl
sumTrim.pl sampleOrder
sumReadN.pl sampleOrder

# run for all samples
matchAllSamples.pl
sumDist.pl sampleOrder
sumRate.pl sampleOrder

# summarize features
sumFeature.pl sampleOrder
desFeature.pl all_sample.feature
taxFeature.pl all_sample_des.feature
sumDomain.pl all_sample_anno.feature
divideFeature.pl all_sample_anno.feature --without-rtRNA
sumTax.pl all_sample_bacteria_anno.feature
sumTax.pl all_sample_fungi_anno.feature
sumTax.pl all_sample_virus_anno.feature
sumTax.pl all_sample_plant_anno.feature
sumTax.pl all_sample_mammal_anno.feature
sumTax.pl all_sample_chordata_anno.feature
sumTax.pl all_sample_bug_anno.feature
sumTax.pl all_sample_worm_anno.feature
sumTax.pl all_sample_other_anno.feature
sumMolType.pl all_sample_human_anno.feature
./mergeExo.sh
addCommonName.pl all_sample_exogenous_anno.feature

divideMatchType.pl all_sample_rtRNA_anno.feature
divideMatchType.pl all_sample_human_anno.feature -by-refDB
divideMatchType.pl all_sample_bacteria_anno.feature
divideMatchType.pl all_sample_fungi_anno.feature
...

# summarize profiles
sumProfile.pl sampleOrder
desProfile.pl all_sample.profile
taxProfile.pl all_sample_des.profile
divideMatchType.pl all_sample_anno.profile
or
sumProfile.pl sampleOrder
sumFeatureP.pl all_sample.profile
or
sumProfileH.pl sampleOrder
(if sample size is greater than 40, when running in a 32G memory mahcine)

# clean memory
sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"