Skip to content

Commit dd05c70

Browse files
PODCAT-1022: SRA study should be a link (#280) (#281)
* PODCAT-1022: SRA study should be a link Added SRA STUDY IDENTIFIER link out * changed title changed title Co-authored-by: Ruoxi Zhang <116577061+RuoxiZhang08@users.noreply.github.com>
1 parent c068eb7 commit dd05c70

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/pages/datasetDetailPage/DatasetDetail.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ const DatasetDetail = ({
210210
const grants = new Map();
211211
const geoStudyIdArr = [];
212212
const dataRepositoryArr = [];
213+
const sraIdArr = [];
213214
if (sortedAdditonals) {
214215
if (sortedAdditonals.includes("GRANT ID")) {
215216
additionalDict["GRANT ID"].forEach((item, i) => {
@@ -237,6 +238,11 @@ const DatasetDetail = ({
237238
dataRepositoryArr.push(dataRepositoryItem.k);
238239
});
239240
}
241+
if (sortedAdditonals.includes("SRA STUDY IDENTIFIER")) {
242+
additionalDict["SRA STUDY IDENTIFIER"].forEach(sraItem => {
243+
sraIdArr.push(sraItem.k);
244+
});
245+
}
240246
}
241247

242248
const initializePopover = () => {
@@ -1027,7 +1033,6 @@ const DatasetDetail = ({
10271033
</div>
10281034
);
10291035
});
1030-
10311036
return (
10321037
<>
10331038
<div className="dataElementLabel">GEO STUDY IDENTIFIER</div>
@@ -1044,14 +1049,30 @@ const DatasetDetail = ({
10441049
</div>
10451050
);
10461051
});
1047-
10481052
return (
10491053
<>
10501054
<div className="dataElementLabel">DATA REPOSITORY</div>
10511055
<div id="data_repository">{html}</div>
10521056
</>
10531057
);
10541058
}
1059+
if (ad === "SRA STUDY IDENTIFIER") {
1060+
const html = sraIdArr.map((sraId, idx) => {
1061+
const srakey = `sra_${idx}`;
1062+
const sraLink = ''.concat('https://trace.ncbi.nlm.nih.gov/Traces/?view=study&acc=', sraId);
1063+
return (
1064+
<div className="additionalDataContent" key={srakey}>
1065+
<a href={sraLink} className="additionalDataLinks" target="_blank" rel="noreferrer noopener">{sraId}</a>
1066+
</div>
1067+
);
1068+
});
1069+
return (
1070+
<>
1071+
<div className="dataElementLabel">SRA STUDY IDENTIFIER</div>
1072+
<div id="geo_study_identifier">{html}</div>
1073+
</>
1074+
);
1075+
}
10551076
return (
10561077
<div id={ad.toLocaleLowerCase().split(' ').join('_')}>
10571078
<div key={adkey} className="dataElementLabel">

0 commit comments

Comments
 (0)