Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
bump to 1.4.6
  • Loading branch information
harmjanwestra committed Jul 23, 2019
1 parent 3125831 commit 33903c6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
2 changes: 1 addition & 1 deletion eqtl-mapping-pipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>1.0.3-SNAPSHOT</version>
</parent>
<artifactId>eqtl-mapping-pipeline</artifactId>
<version>1.4.5-SNAPSHOT</version>
<version>1.4.6-SNAPSHOT</version>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import eqtlmappingpipeline.metaqtl3.EQTLRegression;
import eqtlmappingpipeline.metaqtl3.MetaQTL3;
import eqtlmappingpipeline.normalization.Normalizer;
import eqtlmappingpipeline.util.QTLFileMerger;
import gnu.trove.set.hash.THashSet;
import umcg.genetica.console.ConsoleGUIElems;
Expand All @@ -32,6 +33,15 @@ public class IterativeConditionalAnalysis extends MetaQTL3 {

public static void main(String[] args) {

// Normalizer z = new Normalizer();
// try {
// z.rank("D:\\Sync\\SyncThing\\Data\\Ref\\geuvadis\\rnaseq-EUR\\GD660.GeneQuantCount-EUR-CPM-TMM.txt.gz",
// "D:\\Sync\\SyncThing\\Data\\Ref\\geuvadis\\rnaseq-EUR\\GD660.GeneQuantCount-EUR-CPM-TMM-ranked.txt.gz");
// } catch (IOException e) {
// e.printStackTrace();
// }
// System.exit(0);

IterativeConditionalAnalysis s = new IterativeConditionalAnalysis();
try {
s.run("D:\\Sync\\SyncThing\\Data\\Ref\\geuvadis\\2019-07-18-GEUVADIS.xml", null,
Expand All @@ -46,14 +56,11 @@ public static void main(String[] args) {
private Integer startIter = 1;



public void run(String xmlSettingsFile, String texttoreplace, String texttoreplacewith,
String ingt, String inexp, String inexpplatform, String inexpannot, String gte,
String out, boolean cis, boolean trans, int perm, boolean textout, boolean binout, String snpfile, Integer threads) throws IOException, Exception {




initialize(xmlSettingsFile, texttoreplace, texttoreplacewith, ingt, inexp, inexpplatform, inexpannot, gte, out, cis, trans, perm, textout, binout, snpfile, threads, null, null, null, true, true, null, null, null);

double fdrthreshold = m_settings.fdrCutOff;
Expand Down Expand Up @@ -124,7 +131,7 @@ public void run(String xmlSettingsFile, String texttoreplace, String texttorepla
// recalculate mean and SD
for (int i = 0; i < m_gg.length; i++) {
// if (!m_settings.performParametricAnalysis) {
m_gg[i].getExpressionData().rankAllExpressionData(m_settings.equalRankForTies);
// m_gg[i].getExpressionData().rankAllExpressionData(m_settings.equalRankForTies);
// }
// m_gg[i].getExpressionData().calcAndSubtractMean();
// m_gg[i].getExpressionData().calcMeanAndVariance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,27 +393,27 @@ private void regressOutEQTLEffects() throws IOException {
}
}

// if (atLeastOnePCANotRegressedOut) {
//Provide information on the PCAs:
System.out.println("There is at least one PCA that has not been regressed out as it does not explain a lot of genetic variation!:");
for (int pca = 0; pca < nrSNPs; pca++) {
double[] x = dataMatrixPCScores[pca];
double correlation = JSci.maths.ArrayMath.correlation(x, y);
double r2 = correlation * correlation;
int pcaNr = pca + 1;
String snpsStronglyCorrelatedWithPCA = "";
for (int snp = 0; snp < nrSNPs; snp++) {
double correlationPCASNP = Math.abs(JSci.maths.ArrayMath.correlation(x, dataMatrix[snp]));
double r2PCASNP = correlationPCASNP * correlationPCASNP;
if (r2PCASNP > 0.1) {
snpsStronglyCorrelatedWithPCA += "\t" + snpsForProbe.get(snp).getName() + ", " + r2PCASNP;
if (atLeastOnePCANotRegressedOut) {
//Provide information on the PCAs:
System.out.println("There is at least one PCA that has not been regressed out as it does not explain a lot of genetic variation!:");
for (int pca = 0; pca < nrSNPs; pca++) {
double[] x = dataMatrixPCScores[pca];
double correlation = JSci.maths.ArrayMath.correlation(x, y);
double r2 = correlation * correlation;
int pcaNr = pca + 1;
String snpsStronglyCorrelatedWithPCA = "";
for (int snp = 0; snp < nrSNPs; snp++) {
double correlationPCASNP = Math.abs(JSci.maths.ArrayMath.correlation(x, dataMatrix[snp]));
double r2PCASNP = correlationPCASNP * correlationPCASNP;
if (r2PCASNP > 0.1) {
snpsStronglyCorrelatedWithPCA += "\t" + snpsForProbe.get(snp).getName() + ", " + r2PCASNP;
}
}
System.out.println(probes[p] + "\tPCA" + pcaNr + "\tExplainedVariance:\t" + PCA.getEigenValueVar(eigenValues, pca) + "\tEigenvalue:\t" + eigenValues[eigenValues.length - 1 - pca] + "\tPCATraitR2:\t" + r2 + "\tSNPsStronglyCorrelatedWithPCA:\t" + snpsStronglyCorrelatedWithPCA);
System.out.println("PC" + pcaNr + " correlation with phenotype: " + JSci.maths.ArrayMath.correlation(y, dataMatrix[pca]));
}
System.out.println(probes[p] + "\tPCA" + pcaNr + "\tExplainedVariance:\t" + PCA.getEigenValueVar(eigenValues, pca) + "\tEigenvalue:\t" + eigenValues[eigenValues.length - 1 - pca] + "\tPCATraitR2:\t" + r2 + "\tSNPsStronglyCorrelatedWithPCA:\t" + snpsStronglyCorrelatedWithPCA);
System.out.println("PC" + pcaNr + " correlation with phenotype: " + JSci.maths.ArrayMath.correlation(y, dataMatrix[pca]));
System.out.println("");
}
System.out.println("");
// }

//Process each PC, determine total amount of variation explained by the combination of PCs:
double propExplainedVarianceTrait = 0;
Expand Down

0 comments on commit 33903c6

Please sign in to comment.