Skip to content

Commit

Permalink
put 10X config parameter into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
CuijieLu committed Apr 1, 2024
1 parent a9f0a1e commit 8fbc4b7
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 13 deletions.
78 changes: 78 additions & 0 deletions scripts/cellranger_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# work folder
STATS_AREA = "/igo/stats/CELLRANGER/"

# config info
ACCESS = 0o775
config_dict = {
"count": {
"tool": " /igo/work/nabors/tools/cellranger-8.0.0/cellranger count ",
"genome": {
"Human": " --transcriptome=/igo/work/nabors/genomes/10X_Genomics/GEX/refdata-gex-GRCh38-2020-A ",
"Mouse": " --transcriptome=/igo/work/nabors/genomes/10X_Genomics/GEX/refdata-gex-mm10-2020-A "
}
},
"vdj": {
"tool": " /igo/work/nabors/tools/cellranger-8.0.0/cellranger vdj ",
"genome": {
"Human": " --reference=/igo/work/genomes/10X_Genomics/VDJ/refdata-cellranger-vdj-GRCh38-alts-ensembl-7.0.0 ",
"Mouse": " --reference=/igo/work/genomes/10X_Genomics/VDJ/refdata-cellranger-vdj-GRCm38-alts-ensembl-7.0.0 "
}
},
"atac_count": {
"tool": " /igo/work/nabors/tools/cellranger-atac-2.1.0/cellranger-atac count ",
"genome": {
"Human": " --reference=/igo/work/nabors/genomes/10X_Genomics/ATAC/refdata-cellranger-atac-GRCh38-1.0.1 ",
"Mouse": " --reference=/igo/work/nabors/genomes/10X_Genomics/ATAC/refdata-cellranger-atac-mm10-1.1.0 "
}
},
"cnv": {
"tool": " /igo/work/nabors/tools/cellranger-dna-1.1.0/cellranger-dna cnv ",
"genome": {
"Human": " --reference=/igo/work/nabors/10X_Genomics/CNV/refdata-GRCh38-1.0.0 ",
"Mouse": " --reference=/igo/work/nabors/10X_Genomics/CNV/refdata-GRCm38-1.0.0 "
}
},
"multi": {
"tool": " /igo/work/nabors/tools/cellranger-8.0.0/cellranger multi "
},
"arc": {
"tool": " /igo/work/bin/cellranger-arc-2.0.2/cellranger-arc count ",
"genome": {
"Human": " --reference=/igo/work/nabors/genomes/10X_Genomics/ARC/refdata-cellranger-arc-GRCh38-2020-A-2.0.0 ",
"Mouse": " --reference=/igo/work/nabors/genomes/10X_Genomics/ARC/refdata-cellranger-arc-mm10-2020-A-2.0.0 "
}
},
"spaceranger": {
"tool": " /igo/work/nabors/tools/spaceranger-3.0.0/spaceranger count ",
"genome": {
"Human": " --transcriptome=/igo/work/nabors/genomes/10X_Genomics/GEX/refdata-gex-GRCh38-2020-A ",
"Mouse": " --transcriptome=/igo/work/nabors/genomes/10X_Genomics/spatial_gex/refdata-gex-mm10-2020-A "
},
"probe": {
"Human": "/igo/work/nabors/genomes/10X_Genomics/spatial_gex/Visium_Human_Transcriptome_Probe_Set_v1.0_GRCh38-2020-A.csv",
"Human_CytAssist": "/igo/work/genomes/10X_Genomics/spaceranger/Visium_Human_Transcriptome_Probe_Set_v2.0_GRCh38-2020-A.csv",
"Mouse": "/igo/work/nabors/tools/spaceranger-3.0.0/external/tenx_feature_references/targeted_panels/Visium_Mouse_Transcriptome_Probe_Set_v1.0_mm10-2020-A.csv",
"Mouse_HD": "/igo/work/nabors/tools/spaceranger-3.0.0/external/tenx_feature_references/targeted_panels/Visium_Mouse_Transcriptome_Probe_Set_v2.0_mm10-2020-A.csv"
}
}
}

# cellranger command line options
OPTIONS = " --nopreflight --jobmode=lsf --mempercore=64 --disable-ui --maxjobs=200"

# 10X recipe list for different pipelines
COUNT_FLAVORS = ["10X_Genomics_GeneExpression-3", "10X_Genomics_GeneExpression-5"]
VDJ_FLAVORS = ["10X_Genomics_VDJ"]
ATAC_FLAVORS = ["10X_Genomics_ATAC"]
CNV_FLAVORS = ["10X_Genomics_CNV"]
ARC_FLAVORS = ["10X_Genomics_Multiome", "10X_Genomics_Multiome_ATAC", "10X_Genomics_Multiome_GeneExpression"]
SPATIAL_FLAVORS = ["10X_Genomics_Visium"]

# we do not want to PROCESS SAIL (15500) or SCRI (12437) projects
SCRI = "12437"
SAIL = "15500"
DO_NOT_PROCESS = [SCRI, SAIL]

VISIUM_ENDPOINT = "https://igolims.mskcc.org:8443/LimsRest/getConfig?igoId="
original_tiff_images_directory = "/rtssdc/mohibullahlab/IGO_Pipeline_Results/Single_Cell/10X_Genomics/TIFF_Images/"
tiff_images_directory = "/igo/work/igo/TIFF_Images/"
19 changes: 6 additions & 13 deletions scripts/cellranger_spatial.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import pandas as pd
import sys
import os
import json
import os.path
import requests
import shutil
import glob


ENDPOINT = "https://igolims.mskcc.org:8443/LimsRest/getConfig?igoId="
original_tiff_images_directory = "/rtssdc/mohibullahlab/IGO_Pipeline_Results/Single_Cell/10X_Genomics/TIFF_Images/"
tiff_images_directory = "/igo/work/igo/TIFF_Images/"

import scripts.cellranger_config as CONFIG

# sample_id can be get from sample sheet, will be the part in front of _IGO_
class Spatial_sample:
Expand All @@ -28,7 +21,7 @@ def __init__(self, sample, project_id):
self.copy_json(project_id)

def get_info_from_LIMS(self):
response = requests.get(ENDPOINT + self.IGO_ID , auth = ("pms", "tiagostarbuckslightbike"), verify = False)
response = requests.get(CONFIG.VISIUM_ENDPOINT + self.IGO_ID , auth = ("pms", "tiagostarbuckslightbike"), verify = False)
response_data = json.loads(response.text.encode("utf8"))
self.chip_position = response_data["chipPosition"]
self.chip_id = response_data["chipID"]
Expand All @@ -37,8 +30,8 @@ def get_info_from_LIMS(self):

def copy_tiff(self, project_id):
# project_id format as Project_12345
source_loc_dir = original_tiff_images_directory + project_id
destination_loc = tiff_images_directory + project_id
source_loc_dir = CONFIG.original_tiff_images_directory + project_id
destination_loc = CONFIG.tiff_images_directory + project_id
destination_file = destination_loc + "/" + self.sample_name + ".tif"
# create TIFF_images director if not exists
if not os.path.exists(destination_loc):
Expand All @@ -56,8 +49,8 @@ def copy_tiff(self, project_id):
# copy json file if exists
def copy_json(self, project_id):
# project_id format as Project_12345
source_loc = original_tiff_images_directory + project_id + "/json/" + self.sample_name + ".json"
destination_loc = tiff_images_directory + project_id
source_loc = CONFIG.original_tiff_images_directory + project_id + "/json/" + self.sample_name + ".json"
destination_loc = CONFIG.tiff_images_directory + project_id
destination_file = destination_loc + "/" + self.sample_name + ".json"

# create director if not exists
Expand Down

0 comments on commit 8fbc4b7

Please sign in to comment.