Skip to main content

CDISC SEND xpt (SAS v5 Transport format) files cleaner

Project description

xptcleaner

  • xptcleaner package provides functions for creating json file for vocabulary mappings and for Standardizing SEND xpt files (SAS v5 Transport format) using CDISC controlled terminologies.

Installation

Using pip

Probably the easiest way: from your conda, virtualenv or just base installation do:

pip install xptcleaner

If you are running on a machine without admin rights, and you want to install against your base installation you can do:

pip install xptcleaner --user

Using source archive or using wheel file

You can choose to install xptcleaner using source archive or using wheel file.

  • Using source archive: Using the below shell command to install the xptcleaner package, assume that the source archive is under 'dist' sub folder. Replace {version} with the correct version number, e.g. 1.0.0.
$ py -m pip install ./dist/xptcleaner-{version}.tar.gz

  • Using wheel: Using the below shell command to install the xptcleaner package, assume that the wheel file is under 'dist' sub folder. Replace {version} with the correct version number, e.g. 1.0.0.
$ py -m pip install ./dist/xptcleaner-{version}-py3-none-any.whl

The following required python packages will be installed during the xptcleaner package installation:

* pandas

* pyreadstat

Functions

gen_vocab(in_file, out_path)

    Create json file for vocabulary mappings.
    Keys are synonyms and values are the CDISC Controlled Terminology Submission values.
    Vocabularies are defined by column values from the tab-delimited files.
    
    Parameters
    ----------
    in_file : str
        List of tab-delimited files with synonyms and preferred terms.
    out_path : str
        output json filename.

standardize_file(input_xpt_dir, output_xpt_dir, json_file)

    Standardizes SEND xpt files using CDISC controlled terminologies.
    Here is the list of CDISC codelist supported.
    - Sex
    - Strain/Substrain
    - Species
    - SEND Severity
    - Route of Administration Response
    - Standardized Disposition Term
    - Specimen
    - Non-Neoplastic Finding Type
    - SEND Control Type
	
     Parameters
    ----------
    input_xpt_dir : str
        input folder name with xpt files under the folder.
    output_xpt_dir : str
        output folder name for writing the cleaned xpt files.
    json_file : str
        json filename used for mapping.

How to use

xptcleaner can be used from python script and from R script.

Use xptcleaner from python script

# xptcleaner and module xptclean import
import xptcleaner
from xptcleaner import xptclean

#input CDISC and Extensible CT files.
infile1="{path to CT file}/SEND_Terminology_EXTENSIBLE.txt"
infile2="{path to CT file}/SEND Terminology_2021_12_17.txt"
#output JSON file
jsonfile="{path to CT file to be created}/SENDct.json"

#Call the gen_vocab function with the input and output files
xptclean.gen_vocab([infile1,infile2],jsonfile)

#Call the standardize_file function to clean the xpt file
rawXptFolder = "{path to xpt files}/96298/"
cleanXptFolder = "{path to cleaned xpt files}/96298/"
xptclean.standardize_file(rawXptFolder, cleanXptFolder, jsonfile)

Use xptcleaner from R script

xptcleaner is integrated with sendigR package. refer to installation and usage on sendigR.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xptcleaner-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xptcleaner-1.0.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file xptcleaner-1.0.0.tar.gz.

File metadata

  • Download URL: xptcleaner-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for xptcleaner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1702646e85ea3fe9bfc1e83f471cbe9f2a5265d96f571bef2502a9bdd8e437cd
MD5 d17fa3b4b1a512c053637ece4732c298
BLAKE2b-256 36eee7e31a32ff4333dacca9d82bcace935401f69fe9b373be2a310f7b690f5a

See more details on using hashes here.

File details

Details for the file xptcleaner-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: xptcleaner-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.2

File hashes

Hashes for xptcleaner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9078d6e3f2333d7ccbce1198aec2b0a72e3f47aaa89bfa1201379370cbf7ace
MD5 9532df97a9a6ab7f5c00846e56a12961
BLAKE2b-256 1065fb143a58fcbcc4ff7995c17ee13d041fcd06317dd84ba4faa6ba9afea12f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page