1
/* $Id: blast_seq.h,v 1.17 2004/10/06 15:00:23 dondosha Exp $
2
* ===========================================================================
5
* National Center for Biotechnology Information
7
* This software/database is a "United States Government Work" under the
8
* terms of the United States Copyright Act. It was written as part of
9
* the author's offical duties as a United States Government employee and
10
* thus cannot be copyrighted. This software/database is freely available
11
* to the public for use. The National Library of Medicine and the U.S.
12
* Government have not placed any restriction on its use or reproduction.
14
* Although all reasonable efforts have been taken to ensure the accuracy
15
* and reliability of the software and data, the NLM and the U.S.
16
* Government do not and cannot warrant the performance or results that
17
* may be obtained by using this software or data. The NLM and the U.S.
18
* Government disclaim all warranties, express or implied, including
19
* warranties of performance, merchantability or fitness for any particular
22
* Please cite the author in any work or product based on this material.
24
* ===========================================================================*/
26
/*****************************************************************************
28
File name: blast_seq.h
30
Author: Ilya Dondoshansky
32
Contents: Functions converting from SeqLocs to structures used in BLAST and
37
******************************************************************************
47
#ifndef NCBI_C_TOOLKIT
48
#define NCBI_C_TOOLKIT
52
#include <algo/blast/core/blast_def.h>
53
#include <algo/blast/core/blast_options.h>
57
/** Convert a BlastMaskLoc list to a list of SeqLocs, used for formatting
59
* @param program_number identifies blastn, blastp, etc. [in]
60
* @param mask_loc internal mask structure [in]
61
* @param slp SeqLoc of query [in]
62
* @return Pointer to SeqLoc
65
BlastMaskLocToSeqLoc(EBlastProgramType program_number,
66
const BlastMaskLoc* mask_loc,
69
/* Converts a SeqLocPtr to a BlastSeqLoc, used for formatting.
70
* @param mask_slp SeqLocPtr to be converted [in]
71
* @return pointer to BlastSeqLoc
73
BlastSeqLoc* BlastSeqLocFromSeqLoc(SeqLocPtr mask_slp);
75
/** Duplicate masks in 6 frames for each nucleotide sequence, converting
76
* all masks' coordinates from DNA to protein.
77
* @param mask_loc_ptr Masks list to be modified [in] [out]
78
* @param slp List of nucleotide query SeqLoc's [in]
80
Int2 BlastMaskLocDNAToProtein(BlastSeqLoc* dna_seqloc, BlastMaskLoc* prot_maskloc, Int4 start, SeqLocPtr slp);
82
Int2 BlastMaskLocDNAToProtein(BlastMaskLoc** mask_loc_ptr, SeqLocPtr slp);
85
/** Convert all masks' protein coordinates to nucleotide.
86
* @param mask_loc_ptr Masks list to be modified [in] [out]
87
* @param slp List of nucleotide query SeqLoc's [in]
89
Int2 BlastMaskLocProteinToDNA(BlastMaskLoc** mask_loc_ptr, SeqLocPtr slp);
91
/** Given a list of query SeqLoc's, create the sequence block and the query
92
* info structure. This is the last time SeqLoc is needed before formatting.
93
* @param query_slp List of query SeqLoc's [in]
94
* @param query_options Query setup options, containing genetic code for
96
* @param program_number Type of BLAST program [in]
97
* @param query_info Query information structure, containing offsets into
98
* the concatenated sequence [out]
99
* @param query_blk Query block, containing (concatenated) sequence [out]
101
Int2 BLAST_SetUpQuery(EBlastProgramType program_number, SeqLocPtr query_slp,
102
const QuerySetUpOptions* query_options,
103
BlastQueryInfo** query_info, BLAST_SequenceBlk* *query_blk);
105
/** Set up the subject sequence block in case of two sequences BLAST.
106
* @param program_number Type of BLAST program [in]
107
* @param subject_slp SeqLoc for the subject sequence [in]
108
* @param subject Subject sequence block [out]
110
Int2 BLAST_SetUpSubject(EBlastProgramType program_number,
111
SeqLocPtr subject_slp, BLAST_SequenceBlk** subject);
113
/** Find a genetic code string in ncbistdaa encoding, given an integer
114
* genetic code value.
115
* @param gc genetic code value [in]
116
* @param genetic_code genetic code string [out]
119
Int2 BLAST_GeneticCodeFind(Int4 gc, Uint1** genetic_code);
124
#endif /* !__BLAST_SEQ__ */