Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CDS DRS mapping data #728

Merged
merged 10 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ that using these commands (requires access to the htan-dcc google project):
cd data
bq extract --destination_format CSV released.entities_v6_1 gs://htan-release-files/entities_v6_1.csv
bq extract --destination_format CSV released.metadata_v6_1 gs://htan-release-files/metadata_v6_1.csv
bq extract --destination_format NEWLINE_DELIMITED_JSON released.cds_drs_mapping gs://htan-release-files/cds_drs_mapping.json
gsutil cp gs://htan-release-files/entities_v6_1.csv entities_v6_1.csv
gsutil cp gs://htan-release-files/metadata_v6_1.csv metadata_v6_1.csv

gsutil cp gs://htan-release-files/cds_drs_mapping.json cds_drs_mapping.json
```

#### Pull files from Synapse and Process for ingestion
Expand Down
64,817 changes: 35,517 additions & 29,300 deletions data/cds_drs_mapping.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/processSynapseJSON.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ ncc: Version 0.28.6
ncc: Compiling file index.js
ncc: Using [email protected] (local user-provided)
40kB sourcemap-register.js
8479kB index.js
8675kB index.js
1425kB index.js.map
8519kB [29085ms] - ncc 0.28.6
8715kB [8766ms] - ncc 0.28.6
Missing ParentBiospecimenID: {
Component: 'ScRNA-seqLevel3',
Filename: 'single_cell_RNAseq_level_3_ped_glioma/HTAN_pHGG_161_New_Reg1_snRNA/barcodes.tsv.gz',
Expand Down
18 changes: 6 additions & 12 deletions data/processSynapseJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ function getReleaseSynapseIds(

function addDownloadSourcesInfo(
file: BaseSerializableEntity,
dbgapSynapseSet: Set<string>,
dbgapImgSynapseSet: Set<string>
) {
if (
Expand All @@ -389,9 +388,8 @@ function addDownloadSourcesInfo(
// them from the portal listing entirely so assume they are there
file.isRawSequencing = true;
if (
file.synapseId &&
(dbgapSynapseSet.has(file.synapseId) ||
file.Filename.endsWith('bai'))
(file.synapseId && file.viewers?.cds?.drs_uri) ||
file.Filename.endsWith('bai')
) {
file.downloadSource = DownloadSourceCategory.dbgap;
} else {
Expand All @@ -402,13 +400,10 @@ function addDownloadSourcesInfo(
if (file.synapseId && dbgapImgSynapseSet.has(file.synapseId)) {
// Level 2 imaging data is open access
// ImagingLevel2, SRRSImagingLevel2 as specified in released.entities table (CDS_Release) column
if (
file.level === 'Level 2' &&
file.Component.startsWith('Imaging')
) {
if (file.viewers?.cds?.drs_uri) {
file.downloadSource = DownloadSourceCategory.cds;
} else {
file.downloadSource = DownloadSourceCategory.dbgap;
file.downloadSource = DownloadSourceCategory.comingSoon;
}
} else if (
file.Component === 'OtherAssay' &&
Expand Down Expand Up @@ -617,7 +612,6 @@ function processSynapseJSON(
ancestryByParticipantID
);

const dbgapSynapseSet = new Set<string>(getDbgapSynapseIds(entitiesById));
const dbgapImgSynapseSet = new Set<string>(
getDbgapImgSynapseIds(entitiesById)
);
Expand Down Expand Up @@ -645,10 +639,10 @@ function processSynapseJSON(
parentData?.therapy || []
).map((d) => d.ParticipantID);

addDownloadSourcesInfo(file, dbgapSynapseSet, dbgapImgSynapseSet);
addViewers(file);
addDownloadSourcesInfo(file, dbgapImgSynapseSet);
addReleaseInfo(file, entitiesById);
addImageChannelMetadata(file, entitiesById);
addViewers(file);
return file as SerializableEntity;
});
// .filter((f): f is SerializableEntity => !!f); // file should be defined (typescript doesnt understand (f=>f)
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function fetchData(): Promise<LoadDataResult> {
const processedSynURL =
process.env.NODE_ENV === 'development'
? '/processed_syn_data.json'
: `${getCloudBaseUrl()}/processed_syn_data_20241204_1543.json`;
: `${getCloudBaseUrl()}/processed_syn_data_20241206_1308.json`;
return fetchSynData(processedSynURL);
}

Expand Down
Binary file modified public/processed_syn_data.json.gz
Binary file not shown.
Binary file modified public/syn_data.json.gz
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to update this file. original json should still be the same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, actually, the file has changed. @inodb did you run the python script again to update the data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's also possible that you had the previous version locally and never updated it to the latest

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch - fixed this now!

Binary file not shown.