Skip to content

Commit

Permalink
v1.4.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wym6912 committed Aug 7, 2023
1 parent bf62969 commit 94b83dd
Show file tree
Hide file tree
Showing 19 changed files with 720 additions and 25 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,23 @@ endif
$(CC) -c $(CFLAGS) $< -I$(INC_DIR) -o $@

BIN = $(BIN_DIR)/abpoa
BIN_PROF = $(BIN_DIR)/abpoa_profile
ifneq ($(gdb),)
BIN = $(BIN_DIR)/gdb_abpoa
endif
ABPOALIB = $(LIB_DIR)/libabpoa.a
EXAMPLE = example


all: $(BIN)
abpoa: $(BIN)
libabpoa: $(ABPOALIB)
example: $(EXAMPLE)
all: $(BIN) $(BIN_PROF)
abpoa: $(BIN)
abpoa_profile: $(BIN_PROF)
libabpoa: $(ABPOALIB)
example: $(EXAMPLE)

$(BIN_PROF): $(SRC_DIR)/abpoa_profile.o $(ABPOALIB)
if [ ! -d $(BIN_DIR) ]; then mkdir $(BIN_DIR); fi
$(CC) $(CFLAGS) $< -I$(INC_DIR) -L$(LIB_DIR) -labpoa $(LIB) -o $@ $(PG_FLAG)

$(BIN):$(SRC_DIR)/abpoa.o $(ABPOALIB)
if [ ! -d $(BIN_DIR) ]; then mkdir $(BIN_DIR); fi
Expand All @@ -108,4 +114,4 @@ $(SRC_DIR)/simd_abpoa_align.o:$(SRC_DIR)/simd_abpoa_align.c $(SRC_DIR)/abpoa_gra
$(CC) -c $(CFLAGS) $(SIMD_FLAG) -I$(INC_DIR) $< -o $@

clean:
rm -f $(SRC_DIR)/*.[oa] $(LIB_DIR)/*.[oa] $(BIN)
rm -f $(SRC_DIR)/*.[oa] $(LIB_DIR)/*.[oa] $(BIN) $(BIN_PROF)
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

Modified by wym6912 wym6912@outlook.com

## Updates (v1.4.1.3)

- Fix a bug related to uninitialized values in local mode
- Add `HOXD70` matrix arugment with gap open penalty\=400 and gap extension penalty\=30 (`-H/--hoxd`)
- Add two profile alignment modes in new program `abpoa_profile`
- Fix output bug in printing sequences has gaps

## Updates (v1.4.1.2)

- Fix bug in outputting RNA sequences in `v1.4.1.1`
Expand Down Expand Up @@ -46,8 +53,8 @@ abPOA is not only a stand-alone tool for MSA and consensus calling, it can also
Download the [latest release](https://github.com/malabz/abPOA/releases):
```bash
wget https://github.com/malabz/abPOA/releases/download/v1.4.1.1/abPOA-v1.4.1.1.tar.gz
tar -zxvf abPOA-v1.4.1.1.tar.gz && cd abPOA-v1.4.1.1
wget https://github.com/malabz/abPOA/releases/download/v1.4.1.3/abPOA-v1.4.1.3.tar.gz
tar -zxvf abPOA-v1.4.1.3.tar.gz && cd abPOA-v1.4.1.3
```
Make from source and run with test data:
```bash
Expand Down
Binary file modified abPOA.rc
Binary file not shown.
10 changes: 10 additions & 0 deletions abPOA.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abPOA_example", "abPOA_exam
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abPOA_sub_example", "abPOA_sub_example.vcxproj", "{3C4CFBB1-36E1-4237-9DD5-3EE3A9EBB83E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abPOA_profile", "abPOA_profile.vcxproj", "{B0559055-ABBA-4035-B384-3DFCBE335E68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -61,6 +63,14 @@ Global
{3C4CFBB1-36E1-4237-9DD5-3EE3A9EBB83E}.Release|x64.Build.0 = Release|x64
{3C4CFBB1-36E1-4237-9DD5-3EE3A9EBB83E}.Release|x86.ActiveCfg = Release|Win32
{3C4CFBB1-36E1-4237-9DD5-3EE3A9EBB83E}.Release|x86.Build.0 = Release|Win32
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Debug|x64.ActiveCfg = Debug|x64
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Debug|x64.Build.0 = Debug|x64
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Debug|x86.ActiveCfg = Debug|Win32
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Debug|x86.Build.0 = Debug|Win32
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Release|x64.ActiveCfg = Release|x64
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Release|x64.Build.0 = Release|x64
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Release|x86.ActiveCfg = Release|Win32
{B0559055-ABBA-4035-B384-3DFCBE335E68}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file added abPOA_profile.rc
Binary file not shown.
157 changes: 157 additions & 0 deletions abPOA_profile.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{b0559055-abba-4035-b384-3dfcbe335e68}</ProjectGuid>
<RootNamespace>abPOAprofile</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(ProjectDir)include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>$(ProjectDir)include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="include\getopt9\src\getopt.vcxproj">
<Project>{a2169bc8-cf99-40bf-83f3-b0e38f7067bd}</Project>
</ProjectReference>
<ProjectReference Include="lib_abPOA.vcxproj">
<Project>{a193f522-5fe5-4012-beea-acfc6be9fc72}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\abpoa_profile.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="abPOA_profile.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
32 changes: 32 additions & 0 deletions abPOA_profile.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\abpoa_profile.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="abPOA_profile.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions abPOA_profile.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
1 change: 1 addition & 0 deletions include/abpoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ typedef struct {
double min_freq; // for multiploid data
int verbose; // to control output msg
int has_u; // detect RNA sequences
int changed_gap_pen;

// char LogTable65536[65536];
// char bit_table16[65536];
Expand Down
20 changes: 13 additions & 7 deletions src/abpoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ char PROG[20] = "abpoa";
#define _bO BOLD UNDERLINE "O" NONE
#define _bA BOLD UNDERLINE "A" NONE
char DESCRIPTION[200] = _ba "daptive " _bb "anded " _bP "artial " _bO "rder " _bA "lignment";
char VERSION[20] = "1.4.1.2";
char VERSION[20] = "1.4.1.3";
char CONTACT[30] = "gaoy1@chop.edu";

const struct option abpoa_long_opt [] = {
Expand Down Expand Up @@ -56,7 +56,9 @@ const struct option abpoa_long_opt [] = {
{ "max-num-cons", 1, NULL, 'd', },
{ "min-freq", 1, NULL, 'q', },
{ "blosum", 0, NULL, 'B', },
{ "hoxd", 0, NULL, 'H', },

{ "verbose", 0, NULL, 'V' },
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'v' },

Expand Down Expand Up @@ -95,6 +97,8 @@ int abpoa_usage(void)
err_printf(" -s --amb-strand ambiguous strand mode [False]\n");
err_printf(" for each input sequence, try the reverse complement if the current\n");
err_printf(" alignment score is too low, and pick the strand with a higher score\n");
err_printf(" -B --blosum use BLOSUM62 scoring matrix for %sprotein%s sequence alignment [False]\n", RED, NONE);
err_printf(" -H --hoxd use HOXD70 scoring matrix for %sDNA/RNA%s sequence alignment [False]\n", RED, NONE);
err_printf(" Adaptive banded DP:\n");
err_printf(" -b --extra-b INT first adaptive banding parameter [%d]\n", ABPOA_EXTRA_B);
err_printf(" set b as < 0 to disable adaptive banded DP\n");
Expand All @@ -116,11 +120,10 @@ int abpoa_usage(void)
err_printf(" Input/Output:\n");
err_printf(" -Q --use-qual-weight take base quality score from FASTQ input file as graph edge weight [False]\n");
err_printf(" -c --amino-acid input sequences are amino acid (default is nucleotide) [False]\n");
err_printf(" -B --blosum use BLOSUM62 for protein alignment [False]\n");
err_printf(" -l --in-list input file is a list of sequence file names [False]\n");
err_printf(" each line is one sequence file containing a set of sequences\n");
err_printf(" which will be aligned by abPOA to generate a consensus sequence\n");
err_printf(" -i --incrmnt FILE incrementally align sequences to an existing graph/MSA [Null]\n");
err_printf(" -i --increment FILE incrementally align sequences to an existing graph/MSA [Null]\n");
err_printf(" graph could be in GFA or MSA format generated by abPOA\n");
err_printf(" -o --output FILE output to FILE [stdout]\n");
err_printf(" -r --result INT output result mode [%d]\n", ABPOA_OUT_CONS);
Expand All @@ -134,6 +137,8 @@ int abpoa_usage(void)
err_printf(" -q --min-freq FLOAT min. frequency of each consensus sequence (only effective when -d/--num-cons > 1) [%.2f]\n", MULTIP_MIN_FREQ);
err_printf(" -g --out-pog FILE dump final alignment graph to FILE (.pdf/.png) [Null]\n\n");

err_printf(" Others: \n");
err_printf(" -V --verbose verbose some output\n");
err_printf(" -h --help print this help usage information\n");
err_printf(" -v --version show version number\n");

Expand Down Expand Up @@ -163,7 +168,7 @@ int abpoa_main(char *file_fn, int is_list, abpoa_para_t *abpt){

int main(int argc, char **argv) {
int c, m, in_list=0; char *s; abpoa_para_t *abpt = abpoa_init_para();
while ((c = getopt_long(argc, argv, "m:M:X:t:O:E:b:f:z:e:QSk:w:n:i:clpsBo:r:g:d:q:hvV:", abpoa_long_opt, NULL)) >= 0) {
while ((c = getopt_long(argc, argv, "m:M:X:t:O:E:b:f:z:e:QSk:w:n:i:clpsBHo:r:g:d:q:hvV", abpoa_long_opt, NULL)) >= 0) {
switch(c)
{
case 'm': m = atoi(optarg);
Expand All @@ -173,8 +178,8 @@ int main(int argc, char **argv) {
case 'M': abpt->match = atoi(optarg); break;
case 'X': abpt->mismatch = atoi(optarg); break;
case 't': abpt->use_score_matrix = 1; abpt->mat_fn = strdup(optarg); break;
case 'O': abpt->gap_open1 = strtol(optarg, &s, 10); if (*s == ',') abpt->gap_open2 = strtol(s+1, &s, 10); break;
case 'E': abpt->gap_ext1 = strtol(optarg, &s, 10); if (*s == ',') abpt->gap_ext2 = strtol(s+1, &s, 10); break;
case 'O': abpt->changed_gap_pen = 1; abpt->gap_open1 = strtol(optarg, &s, 10); if (*s == ',') abpt->gap_open2 = strtol(s+1, &s, 10); break;
case 'E': abpt->changed_gap_pen = 1; abpt->gap_ext1 = strtol(optarg, &s, 10); if (*s == ',') abpt->gap_ext2 = strtol(s+1, &s, 10); break;

case 'b': abpt->wb = atoi(optarg); break;
case 'f': abpt->wf = atof(optarg); break;
Expand Down Expand Up @@ -206,12 +211,13 @@ int main(int argc, char **argv) {
break;
case 'g': abpt->out_pog= strdup(optarg); break;
case 'B': abpt->use_score_matrix = 2; break;
case 'H': abpt->use_score_matrix = 3; break;

case 'd': abpt->max_n_cons = atoi(optarg); break;
case 'q': abpt->min_freq = atof(optarg); break;

case 'h': return abpoa_usage();
case 'V': abpt->verbose = atoi(optarg); break;
case 'V': abpt->verbose ++; break;
case 'v': printf("%s\n", VERSION); goto End; break;
default:
err_printf("Error: unknown option: %s.\n", optarg);
Expand Down
1 change: 1 addition & 0 deletions src/abpoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ typedef struct {
double min_freq; // for multiploid data
int verbose; // to control output msg
int has_u; // detect RNA sequences
int changed_gap_pen;

// char LogTable65536[65536];
// char bit_table16[65536];
Expand Down
Loading

0 comments on commit 94b83dd

Please sign in to comment.