|
21 | 21 | import org.apache.commons.logging.Log;
|
22 | 22 | import org.apache.commons.logging.LogFactory;
|
23 | 23 | import org.springframework.beans.factory.annotation.Autowired;
|
| 24 | +import org.springframework.http.MediaType; |
24 | 25 | import org.springframework.stereotype.Service;
|
25 | 26 | import org.springframework.transaction.annotation.Propagation;
|
26 | 27 | import org.springframework.transaction.annotation.Transactional;
|
|
49 | 50 | import ubic.gemma.model.expression.biomaterial.BioMaterial;
|
50 | 51 | import ubic.gemma.model.expression.designElement.CompositeSequence;
|
51 | 52 | import ubic.gemma.model.expression.experiment.ExpressionExperiment;
|
| 53 | +import ubic.gemma.model.expression.experiment.MetadataType; |
52 | 54 | import ubic.gemma.persistence.service.analysis.expression.pca.PrincipalComponentAnalysisService;
|
53 | 55 | import ubic.gemma.persistence.service.analysis.expression.sampleCoexpression.SampleCoexpressionAnalysisService;
|
54 | 56 | import ubic.gemma.persistence.service.common.auditAndSecurity.AuditTrailService;
|
|
61 | 63 | import ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService;
|
62 | 64 | import ubic.gemma.persistence.util.EntityUtils;
|
63 | 65 |
|
| 66 | +import java.io.File; |
64 | 67 | import java.io.IOException;
|
65 | 68 | import java.util.*;
|
66 | 69 |
|
@@ -189,9 +192,10 @@ public void addAffyDataFromAPTOutput( ExpressionExperiment ee, String pathToAptO
|
189 | 192 | * switched to use it.
|
190 | 193 | * @param countMatrix Representing 'raw' counts (added after rpkm, if provided).
|
191 | 194 | * @param rpkmMatrix Representing per-gene normalized data, optional (RPKM or FPKM)
|
192 |
| - * @param allowMissingSamples if true, samples that are missing data will be deleted from the experiment. |
193 |
| - * @param isPairedReads is paired reads |
194 | 195 | * @param readLength read length
|
| 196 | + * @param isPairedReads is paired reads |
| 197 | + * @param allowMissingSamples if true, samples that are missing data will be deleted from the experiment. |
| 198 | + * @param additionalMetadata |
195 | 199 | */
|
196 | 200 | @Override
|
197 | 201 | @Transactional(propagation = Propagation.NEVER)
|
@@ -280,7 +284,6 @@ public void addCountData( ExpressionExperiment ee, ArrayDesign targetArrayDesign
|
280 | 284 |
|
281 | 285 | this.addData( ee, targetArrayDesign, rpkmEEMatrix );
|
282 | 286 | }
|
283 |
| - |
284 | 287 | }
|
285 | 288 |
|
286 | 289 | /**
|
@@ -545,11 +548,11 @@ public void reprocessAffyDataFromCel( ExpressionExperiment ee ) {
|
545 | 548 | * selected experiment. Will do postprocessing if the data quantitationType is 'preferred', but if there is already
|
546 | 549 | * a preferred quantitation type, an error will be thrown.
|
547 | 550 | *
|
548 |
| - * @param ee ee |
549 |
| - * @param targetPlatform optional; if null, uses the platform already used (if there is just one; you can't use |
550 |
| - * this |
551 |
| - * for a multi-platform dataset) |
552 |
| - * @param data to slot in |
| 551 | + * @param ee ee |
| 552 | + * @param targetPlatform optional; if null, uses the platform already used (if there is just one; you can't use |
| 553 | + * this |
| 554 | + * for a multi-platform dataset) |
| 555 | + * @param data to slot in |
553 | 556 | * @return ee
|
554 | 557 | */
|
555 | 558 | @Override
|
@@ -673,6 +676,19 @@ public ExpressionExperiment replaceData( ExpressionExperiment ee, ArrayDesign ta
|
673 | 676 | return ee;
|
674 | 677 | }
|
675 | 678 |
|
| 679 | + @Override |
| 680 | + @Transactional(propagation = Propagation.NEVER) |
| 681 | + public void addAdditionalMetadata( ExpressionExperiment ee, File[] additionalMetadata, Map<BioAssay, File[]> additionalMetadataPerBioAssay ) { |
| 682 | + for ( File am : additionalMetadata ) { |
| 683 | + experimentService.addAdditionalMetadata( ee, MetadataType.PREPROCESSING, am, MediaType.TEXT_PLAIN_VALUE ); |
| 684 | + } |
| 685 | + for ( Map.Entry<BioAssay, File[]> e : additionalMetadataPerBioAssay.entrySet() ) { |
| 686 | + for ( File am : e.getValue() ) { |
| 687 | + experimentService.addAdditionalMetadata( ee, e.getKey(), MetadataType.PREPROCESSING, am, MediaType.TEXT_PLAIN_VALUE ); |
| 688 | + } |
| 689 | + } |
| 690 | + } |
| 691 | + |
676 | 692 | /**
|
677 | 693 | * RNA-seq
|
678 | 694 | *
|
|
0 commit comments