SCRIdb.tools.json_jobs

SCRIdb.tools.json_jobs(sample_data, config_path, save=True)

Constructor for json formatted files for batch processing of hashtag samples. It Compiles input and label files for each sample in the provided data frame.

Parameters
  • sample_data (DataFrame) – Data frame of samples to be processed

  • config_path – Path to root directory of hashtag pipeline executable submit.sh. It also serves as the parent directory for config where .json files will be written.

  • save (bool) – Save a copy on jobs file to path defined in config_jobs_yml, else return a copy.

Return type

list

Returns

Inputs, labels, and a list of excluded samples

Example

>>> from SCRIdb.worker import *
>>> args = json.load(open(os.path.expanduser("~/.config.json")))
>>> db_connect.conn(args)
>>> f_in=[
            "Sample_CCR7_DC_1_HTO_IGO_10587_12",
            "Sample_CCR7_DC_2_HTO_IGO_10587_13",
            "Sample_CCR7_DC_3_HTO_IGO_10587_14",
            "Sample_CCR7_DC_4_HTO_IGO_10587_15"
    ]
>>> f_in = " ".join(f_in)
>>> source_path="/Volumes/peerd/FASTQ/Project_10587/MICHELLE_0194"
>>> target_path="s3://dp-lab-data/sc-seq/Project_10587"
>>> sd = pd.DataFrame(
        {
            "proj_folder": [source_path],
            "s3_loc": [target_path],
            "fastq": [f_in]
        }
    )
>>> sample_data = sample_data_frame(sd)
>>> inputs_labels, exclude_s = json_jobs(
        sample_data,
        config_path=os.path.expanduser("~/sharp-0.0.1"),
    )