Saturday, February 14, 2015

Data Transport Across Different Platforms: Creating and Reading the SAS transport files (.xpt, .cpt, .dat)

Since there are different computer platforms (Windows - PC, Unix, Linux, OpenVMS), it is often necessary to create the transport file so that the data file created in one platform can be used in another platform. SAS is the primary data format used in pharmaceutical/biotech companies and SAS data format is generally the data format in regulatory submissions. In an early posting "Submit the Clinical Trial Datasets to FDA: Using the right .xpt file format", I discussed that for FDA submission, the SAS transport file must be generated using xport engine (i.e, using PROC COPY).

Creating .xpt file using PROC COPY

While possible, this should be using a standard way to create the SAS transport file. 

libname source 'SAS-library-on-sending-host';   /*indicating where the original SAS data sets (in .sas7bdat format) are*/
libname xptout xport 'filename-on-sending-host'/*indicating where the .xpt files to be stored */
proc copy in=source out=xptout memtype=data;
run;

Reading .xpt file generated with PROC COPY


For recipients, the SAS transport file in .xpt format needs to be converted back to SAS data format so that the further data manipulation / analysis can be performed. To read the .xpt file generated using PROC COPY, we will still use PROC COPY:

libname sasfolder "SAS-library-on-receiving-host"/*indicating where the converted SAS data sets (in .sas7bdat format) to be stored*/
libname xptfile xport '\folder\xyz.xpt' access=readonly; /*indicating which the .xpt files to be read in */
proc copy inlib=xptfile outlib=sasfolder;
run;
 
We can also use SAS data step to read the .xpt file. Or we may just read .xpt file in without creating a permanent SAS data set.  
libname xportin xport '\folder\transport-file-name.xpt';
libname target '\folder\';
data target.transport-file-name; *create a permanent SAS data set;
set xportin.transport-file-name ;
run;
data transport-file-name;  *create a temporary SAS data set;
set xportin.transport-file-name;
run;

Creating .xpt file using PROC CPORT

In SAS, the transport file can be generated with PROC CPORT (not recommended for regulatory submission) with the following statement.  
          filename xptfile "c:\temp\test.xpt";
libname source "c:\sourcedata\";
***For converting a data set;
proc cport library=source file=xptfile memtype=data;
run;
***For converting a format catalog;
proc cport library=source file=xptfile memtype=catalog;
run;
If we strictly follow the name convention, the SAS transport file created with PROC CPORT should use the file extension .cpt (versus .xpt for SAS transport file generated with PROC XPORT). Unfortunately, people may not follow the conversion and use .xpt for SAS transport files generated either with PROC XPORT or PROC CPORT). 

Reading .xpt file generated with PROC CPORT

To read the .xpt file created by PROC CPORT, PROC CIMPORT:
FILENAME xpt 'transport_file_name.xpt';
libname dest 'destination_directory_name';
PROC CIMPORT INFILE= xpt LIBRARY=Dest;
run;
Read the transport file in other format/extensions (.dat, .cpt). 

We may also receive data in other format for example, the transport data file may be in .dat format. Data with .DAT extension indicates a data file that has arbitrary data. That means it’s not associated with any one particular program or application. The following program can be used to read the data into SAS. 
libname outlib 'C:\TEMP';
filename infile 'TAL050003XF.dat';
proc cimport library=outlib file=infile;
run;
The file with .cpt extension is the transport file generated using SAS PROC CPORT as described above. 

Sunday, February 01, 2015

Adverse Event of Special Interest (AESI), Standardized MedDRA Query (SMQs), Customer Queries (CQs) or Customer MedDRA Queries (CMQs), and SAS Programming

When we perform the safety analyses for clinical trial data or post-marketing pharmacovigilence data, one of the common approach is to identify and summarize the adverse events of special interest (AESI). FDA guidance for industry: E2F Development Safety Update Report defined the AESI as following:
“Adverse event of special interest: An adverse event of special interest (serious or non-serious) is one of scientific and medical concern specific to the sponsor’s product or program, for which ongoing monitoring and rapid communication by the investigator to the sponsor can be appropriate. Such an event might warrant further investigation in order to characterize and understand it. Depending on the nature of the event, rapid communication by the trial sponsor to other parties (e.g., regulators) might also be warranted. (Based on CIOMS VI)”
ICH Topic E2F Development Safety Update Report also indicated the importance of identifying the AESIs:
“If important and appropriate, the report should also include adverse reactions of special interest within the line listings and adverse events of special interest in summary tabulations. The basis for selection of such events/reactions should be explained. “
Since the same AESI may include many verbatim (reported) terms or preferred (coded) terms, the first step of the analysis of AESI is to define the list of terms that will be considered as the specific AESI.

I used to do a large phase III study in Irritable Bowel Syndrome (IBS). The protocol specified the diarrhea and rectal bleeding events as AESI. In developing the statistical analysis plan (SAP), the following tables were included to to identify the diarrhea events and rectal bleeding events. .

Adverse Event of Special Interest
Group term
Preferred term
Diarrhea
Diarrhea NOS

Loose stools, stools loose

Loose bowel, loose bowels

Watery diarrhea (diarrhoea)

Stools watery

Gastroenteritis

Gastroenteritis NOS

Gastroenteritis non-infectious
Rectal bleeding
Rectal bleeding

Rectal haemorrhage

Anal haemorrhage

GI h(a)emorrhage

GI h(a)emorrhage NOS

Diarrhea haemorrhagic

Haemorrhage rectum

Blood in stool

Occult blood

Melaena

Hematochezia

Lower GI bleeding (not found)

In 131st Meeting of the Vaccines and Related Biological Products Advisory Committee (VRBPAC) in 2012, the adverse event of special interest regarding autoimmune events was discussed. The meeting minutes explained how the autoimmune events were identified:
"The first was adverse events of special interest. This involved the identification, categorization and analysis of adverse events in the safety database. It was performed using a list of autoimmune and inflammatory conditions. The system was used for all trials in the HEPLISAV clinical program including the Phase 3 trials."
In FDA’s advisory committee meeting to discuss BioMarin Vimizim (elosulfase alfa) for the treatment of Mucopolysaccharidosis Type IVA (Morquio A syndrome), the AESI of hypersensitivity and anaphylactic reaction events was discussed:
“Potential Hypersensitivity AEs were identified by utilizing the broad Anaphylactic Reaction algorithmic Standardized MedDRA query (SMQ) and the broad Angioedema SMQ, which represent a broad range of terms to detect signals possibly indicative of hypersensitivity. Hypersensitivity AEs were reported in 16.2% of subjects in the Proposed Dose Population. No correlation was found between higher titers of anti-BMN 110 antibodies and increased incidence or severity of hypersensitivity AEs. The Warnings and Precautions section of the proposed prescribing information includes language regarding the clinical study experience with anaphylaxis and severe allergic reactions and provides recommended management of and preventive measures for severe allergic-type hypersensitivity reactions. o BioMarin reviewed all reported adverse events against the NIAID/FAAN 2006 criteria for anaphylaxis (Sampson H et al, 2006). Of the 235 subjects exposed to BMN 110 in the development program, the sponsor identified  16 (6.8%) cases consistent with NIAID/FAAN 2006 criteria for anaphylaxis. The reactions were successfully managed with infusion rate adjustments and/or medical intervention, and all but 2 subjects continue to receive subsequent BMN 110 infusions. This rate of anaphylaxis is comparable to other enzyme replacement therapies”
To discuss the AESI, we must know the concept of SMQ. To assist in standardizing the AESI identification process, Standardised MedDRA Queries (SMQs) are developed to facilitate retrieval of MedDRA-coded data as a first step in investigating drug safety issues in pharmacovigilance and clinical development. SMQs are validated, pre-determined sets of MedDRA terms grouped together after extensive review, testing, analysis, and expert discussion. SMQs are a unique feature of MedDRA and provide a strong tool to support safety analysis and reporting. The SMQ topics are intended to address the important pharmacovigilance topics needed by regulatory and industry users. SMQs have been developed with the CIOMS Working Group on Standardised MedDRA Queries that provides pharmacovigilance expertise and validation of SMQs. The SMQs are maintained with each release of MedDRA dictionary by the MSSO.

As of 1 September 2014, there are almost 100 SMQs available. The list of available SMQs can be found here from MSSO website.

If we need to identify a risk or AESI, if SMQ is available, SMQ should be used. If SMQ is not available, the customer-defined list of preferred terms (PTs), so-called CQs (customer queries), will be needed. For three AESIs discussed above, SMQs are available for Diarrhea (as Noninfectious diarrhoea) and Hypersensitivity, but not available for rectal bleeding events. In an ophthalmology paper, both SMQ and customer-defined PTs (CQs) were used to identify various risks. Similarly, in a T2DM study, both SMQ and customer-defined PTs were used to identified various AESIs.

In practice, once we have the database containing all AEs and we have a list of preferred terms (either from SMQ or from the customer-defined [CQs or CMQs]) to identify the AE of special interest, a simple SAS program with PROC SQL can be used to identify the reported events from the database.

Here the AE database is the base table. SMQ preferred terms or customer-defined preferred terms (CQs) is the look-up table. 

proc sql;
    ***Create a look up table where pt is preferred term;
    create table LookupTable as
    select distinct range, pt
    from smq
    where range = 'Narrow';

    ***Select records based on the look-up table;
    create table matched_terms as
    select subjid, aeterm, pt label='Preferred Term'
    from ae
    where upcase(pt) in (select upcase(pt) from LookupTable);
quit;

proc print data=matched_terms label noobs;
run;

The following papers discussed how to use SAS to perform the safety analysis using SMQ.

CDISC “Analysis Data Model (ADaM) Data Structure for Adverse Event Analysis” discussed MedDRA SMQ, included a specific section “4.1.9 MedDRA Query Variables”, and provided an example for analysis of Hemorrhages using SMQ.