NCBI Home PageNCBI Site Search pageNCBI Guide that lists and describes the NCBI resources
Structure Home 3D Macromolecular Structures Conserved Domains   PubChem    BioSystems   Help? 
Search across Entrez databases [Clear]  Help

in Entrez:

Revised 01/25/2013

Fasta-to-CD Converter

Also distributed with CDTree is a utility called 'fa2cd'.

This is a stand-alone command-line utility that can convert a multiple alignment in FASTA format (also called 'mFASTA' format) into a conserved domain 'CD file' that can be used as input to CDTree or Cn3D. The standard file extension for such files is '.cn3'. The mFASTA input file should contain, sequentially, one FASTA formatted record for each aligned row and a gap is indicated with the '-' character.

By default, fa2cd performs a formal convertion of the input mFASTA alignment, assigns a sequential, numeric identifier to each input sequence and chooses a 'master' sequence. It does not attempt to perform validation of accessions or sequence data in the input against NCBI or other database resources.

The following sections provide some information on modifying the program's default functionality, and hints for the more prominent command-line options. A description of all command-line options is obtained via the '-help' flag, and a short summary is available with '-h'.

fa2cd does not do the reverse conversion and create a FASTA file from a CD file. However, you may open a CD file in Cn3D and in the alignment window use the 'View->Export' menu command for this purpose.

Specifying a Master Sequence (the '-mr' option)

For a file read by CDTree or Cn3D, the first sequence in the alignment is the reference, or 'master' sequence. Whenever possible, CDD domain models choose a sequence with an experimentally determined 3D structure as the master so as to better inform the resulting multiple alignment.

By default, the converter chooses the 'best' possible master sequence as determined by a heuristic that seeks to maximize the number of residues on the master aligned to all sequences, while minimizing the number of gaps. The '-mr' and '-keepMaster' options (the latter being equivalent to -mr 1) allow the user to force a specific master to be chosen. If both are provided, the -mr flag is used.

Sequence Identifiers (the '-parseIds' option)

By default, the converter simply assigns a numeric identifier to each sequence in the input file and the defline for each sequence (the preamble line starting with a '>' character) is preserved as a plain-text description elsewhere in the output CD file. If you provide the '-parseIds' option, the converter will instead try and interpret the identifiers it finds in the defline based on the standard formatting used at NCBI. (Additional non-NCBI sequence identifier formats will not be supported by this utility.)

When using '-parseIds', if an identifier is not parsed as a recognizable type, it will simply be treated as free-form text. Should there be no text found that can be used as an identifier, one will be assigned as in the default situation. You may encounter parser warnings in this mode; if the output is unacceptable in such cases you may have to use the default behavior instead.

To reiterate the above caution: no validation is performed that an identifier in fact corresponds to a valid accession for any sequence database, nor that the input sequence data is in fact the same sequence associated with the identifier in the source sequence database.

The '-ibm' Option

One important distinction between mFASTA-represented alignments and the alignment representation in a CD file should be kept in mind in when using this converter. In general, an mFASTA alignment may have a residue in the first (i.e., reference) sequence aligned to a gap in every other sequence in the alignment. All conserved domains in the CDD, however, have a 'block structure' in which every aligned residue in the reference sequence is aligned to a residue on each in every other sequence in the multiple alignment. An algorithm termed 'intersection by master' (IBM) can generate a multiple alignment obeying the CDD constraints from one that does not by simply truncating any alignment column containing a gap. (Clearly, the reverse transformation is not possible.)

The fa2cd converter can output a CD file from the input mFASTA with or without running the IBM algorithm. By default, IBM is not run the input alignment is preserved without truncation. The '-ibm' flag truncates the input alignment to remove gap-containing columns consistent with CDD conventions. Neither CDTree nor Cn3D require that an input multiple alignment have a valid block structure in the sense described. However note that a) Cn3D's alignment viewer displays alignments as if IBM were run, and b) those CDTree functions that assume a CDD-style alignment may fail and generate warning messages.

Citing CDD: Marchler-Bauer A, Zheng C, Chitsaz F, Derbyshire MK, Geer LY, Geer RC, Gonzales NR, Gwadz M, Hurwitz DI, Lanczycki CJ, Lu F, Lu S, Marchler GH, Song JS, Thanki N, Yamashita RA, Zhang D, Bryant SH. CDD: conserved domains and protein three-dimensional structure. Nucleic Acids Res. 2013 Jan 1;41(D1):D348-52. 2012 Nov 28.   (Additional articles about NCBI's Conserved Domains Resources are accessible from the publications page.)

| Disclaimer | Privacy statement | Accessibility |
NCBI Home NCBI Search NCBI SiteMap