示例#1
0
def create_simdata_token_test_dir(directory):
    """
    Create temporary test directories. The directory structure is of
    consistent with that expected by
    :py:const:`riboviz.test.SIMDATA_UMI_CONFIG`
    and :py:const:`riboviz.test.SIMDATA_MULTIPLEX_CONFIG` after
    application of :py:func:`tokenize_config_in_place` and assuming when
    a workflow is run the user provides values for the environment
    variable (:py:const:`riboviz.params.ENV_DIRS`) corresponding to
    the tokens. The directory is structured as follows::

        <directory>
          data/
            # Symholic links to <riboviz>/data/ files:
            yeast_codon_pos_i200.RData
            yeast_features.tsv
            yeast_standard_asite_disp_length.txt
            yeast_tRNAs.tsv
          organisms/
            # Symholic links to <riboviz>/vignette/input/ files:
            yeast_rRNA_R64-1-1.fa
            yeast_YAL_CDS_w_250utrs.fa
            yeast_YAL_CDS_w_250utrs.gff3
          samples/
            simdata/
              # Symholic links to <riboviz>/data/simdata/ files:
              umi5_umi3_umi_adaptor.fastq
              multiplex_umi_barcode_adaptor.fastq
              multiplex_barcodes.tsv

    The directories returned are as follows:

    * organisms: ``<directory>/organisms/``
    * samples: ``<directory>/samples/``
    * data: ``<directory>/data/``

    :param directory: Directory
    :type directory: py._path.local.LocalPath
    :return: organisms directory, samples directory, data directory
    :rtype: tuple(str or unicode, str or unicode, str or unicode)
    """
    organisms_dir = directory.mkdir("organisms")
    samples_dir = directory.mkdir("samples")
    simdata_dir = samples_dir.mkdir("simdata")
    data_dir = directory.mkdir("data")
    test.symlink_files(organisms_dir, test.ORGANISM_FILES)
    test.symlink_files(simdata_dir, test.SIMDATA_INPUT_FILES)
    test.symlink_files(data_dir, test.DATA_FILES)
    return str(organisms_dir), str(samples_dir), str(data_dir)
示例#2
0
def create_simdata_test_dir(directory):
    """
    Create temporary test directories. The directory structure is of
    consistent with that expected by
    :py:const:`riboviz.test.SIMDATA_UMI_CONFIG`
    and :py:const:`riboviz.test.SIMDATA_MULTIPLEX_CONFIG`. The
    directory is structured as follows::

        <directory>
          data/
            simdata/
              # Symholic links to <riboviz>/data/simdata/ files:
              umi5_umi3_umi_adaptor.fastq
              multiplex_umi_barcode_adaptor.fastq
              multiplex_barcodes.tsv
            # Symholic links to <riboviz>/data/ files:
            yeast_codon_pos_i200.RData
            yeast_features.tsv
            yeast_standard_asite_disp_length.txt
            yeast_tRNAs.tsv
          vignette/
            input/
              # Symholic links to <riboviz>/vignette/input/ files:
              yeast_rRNA_R64-1-1.fa
              yeast_YAL_CDS_w_250utrs.fa
              yeast_YAL_CDS_w_250utrs.gff3

    The directories returned are as follows:

    * organisms: ``<directory>/vignette/input/``
    * samples: ``<directory>/data/``
    * data: ``<directory>/data/``

    :param directory: Directory
    :type directory: py._path.local.LocalPath
    :return: organisms directory, samples directory, data directory
    :rtype: tuple(str or unicode, str or unicode, str or unicode)
    """
    input_dir = directory.mkdir("vignette").mkdir("input")
    data_dir = directory.mkdir("data")
    simdata_dir = data_dir.mkdir("simdata")
    test.symlink_files(input_dir, test.ORGANISM_FILES)
    test.symlink_files(simdata_dir, test.SIMDATA_INPUT_FILES)
    test.symlink_files(data_dir, test.DATA_FILES)
    return str(input_dir), str(simdata_dir), str(data_dir)
示例#3
0
def create_vignette_test_dir(directory):
    """
    Create temporary test directories. The directory structure is of
    consistent with that expected by
    :py:const:`ribeviz.test.VIGNETTE_CONFIG`. The
    directory is structured as follows::

        <directory>
          data/
            # Symholic links to <riboviz>/data/ files:
            yeast_codon_pos_i200.RData
            yeast_features.tsv
            yeast_standard_asite_disp_length.txt
            yeast_tRNAs.tsv
          vignette/
            input/
              # Symholic links to <riboviz>/vignette/input/ files:
              yeast_rRNA_R64-1-1.fa
              yeast_YAL_CDS_w_250utrs.fa
              yeast_YAL_CDS_w_250utrs.gff3
              # Symholic links to <riboviz>/vignette/input/ files:
              SRR1042855_s1mi.fastq.gz
              SRR1042864_s1mi.fastq.gz

    The directories returned are as follows:

    * organisms: ``<directory>/vignette/input/``
    * samples: ``<directory>/vignette/``
    * data: ``<directory>/data/``

    :param directory: Directory
    :type directory: py._path.local.LocalPath
    :return: organisms directory, samples directory, data directory
    :rtype: tuple(str or unicode, str or unicode, str or unicode)
    """
    vignette_dir = directory.mkdir("vignette")
    input_dir = vignette_dir.mkdir("input")
    data_dir = directory.mkdir("data")
    test.symlink_files(input_dir, test.ORGANISM_FILES)
    test.symlink_files(input_dir, test.VIGNETTE_INPUT_FILES)
    test.symlink_files(data_dir, test.DATA_FILES)
    return str(input_dir), str(vignette_dir), str(data_dir)
示例#4
0
def create_vignette_default_token_test_dir(directory):
    """
    Create temporary test directories. The directory structure is of
    consistent with that expected by
    :py:const:`riboviz.test.VIGNETTE_CONFIG` after
    application of :py:func:`tokenize_config_in_place` and assuming when
    a workflow is run the user does not provide values for the
    environment variable (:py:const:`riboviz.params.ENV_DIRS`)
    corresponding to the tokens. The directory is structured as
    follows::

        <directory>
          # Symholic links to <riboviz>/data/ files:
          yeast_codon_pos_i200.RData
          yeast_features.tsv
          yeast_standard_asite_disp_length.txt
          yeast_tRNAs.tsv
          # Symholic links to <riboviz>/vignette/input/ files:
          yeast_rRNA_R64-1-1.fa
          yeast_YAL_CDS_w_250utrs.fa
          yeast_YAL_CDS_w_250utrs.gff3
          input/
            # Symholic links to <riboviz>/vignette/input/ files:
            SRR1042855_s1mi.fastq.gz
            SRR1042864_s1mi.fastq.gz

    The directories returned are as follows:

    * organisms: ``<directory>/``
    * samples: ``<directory>/input/``
    * data: ``<directory>/``

    :param directory: Directory
    :type directory: py._path.local.LocalPath
    :return: organisms directory, samples directory, data directory
    :rtype: tuple(str or unicode, str or unicode, str or unicode)
    """
    input_dir = directory.mkdir("input")
    test.symlink_files(directory, test.ORGANISM_FILES)
    test.symlink_files(input_dir, test.VIGNETTE_INPUT_FILES)
    test.symlink_files(directory, test.DATA_FILES)
    return str(directory), str(input_dir), str(directory)