From 355a18854ea526f70739ca73d2e398b3f4554969 Mon Sep 17 00:00:00 2001 From: wym6912 Date: Tue, 22 Aug 2023 21:36:06 +0800 Subject: [PATCH] v1.4.1.5 --- README.md | 26 +++++++++++++++++++++----- abPOA.rc | Bin 4522 -> 4522 bytes abPOA_profile.rc | Bin 4592 -> 4592 bytes src/abpoa.c | 2 +- src/abpoa_align.c | 31 +++++++++++++++++++++++++++++++ src/abpoa_output.c | 6 +++--- src/abpoa_profile.c | 2 +- test_data/all_0_len.fasta | 5 +++++ test_data/has_0_len.fasta | 8 ++++++++ 9 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 test_data/all_0_len.fasta create mode 100644 test_data/has_0_len.fasta diff --git a/README.md b/README.md index 9e7a5ae..ba999c0 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ Modified by wym6912 wym6912@outlook.com +## Updates (v1.4.1.5) + +- Try to fix a bug on processing 0 length sequence +- Add sequence comment print + ## Updates (v1.4.1.4) - Fix a critical bug on freeing SIMD varibles in Windows programs @@ -58,8 +63,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.3/abPOA-v1.4.1.3.tar.gz -tar -zxvf abPOA-v1.4.1.3.tar.gz && cd abPOA-v1.4.1.3 +wget https://github.com/malabz/abPOA/releases/download/v1.4.1.5/abPOA-v1.4.1.5.tar.gz +tar -zxvf abPOA-v1.4.1.5.tar.gz && cd abPOA-v1.4.1.5 ``` Make from source and run with test data: ```bash @@ -73,7 +78,7 @@ abpoa ./test_data/seq.fa > cons.fa ### Windows -Download the [latest release](https://github.com/malabz/abPOA/releases/download/v1.4.1.1/abPOA-v1.4.1.1.tar.gz) and use `Bandizip`, `WinRAR` or any other archive manager software. +Download the [latest release](https://github.com/malabz/abPOA/releases/download/v1.4.1.5/abPOA-v1.4.1.5.tar.gz) and use `Bandizip`, `WinRAR` or any other archive manager software. Make programs from `Visual Studio 2022`: - First of all, download and install [`Visual Studio 2022`](https://visualstudio.microsoft.com/vs/). @@ -111,8 +116,20 @@ abpoa ./test_data/seq.fa > cons.fa ## Table of Contents - [abPOA: adaptive banded Partial Order Alignment](#abpoa-adaptive-banded-partial-order-alignment) - - [Updates (v1.4.1)](#updates-v141) +- [Modified by wym6912](#modified-by-wym6912) + - [Updates (v1.4.1.5)](#updates-v1415) + - [Updates (v1.4.1.4)](#updates-v1414) + - [Updates (v1.4.1.3)](#updates-v1413) + - [Updates (v1.4.1.2)](#updates-v1412) + - [Updates (v1.4.1.1)](#updates-v1411) + - [Windows support](#windows-support) + - [For development in Windows](#for-development-in-windows) - [Getting started](#getting-started) + - [Linux](#linux) + - [Windows](#windows) +- [RAW README](#raw-readme) + - [Updates (v1.4.1)](#updates-v141) + - [Getting started](#getting-started-1) - [Table of Contents](#table-of-contents) - [Introduction](#introduction) - [Installation](#installation) @@ -140,7 +157,6 @@ abpoa ./test_data/seq.fa > cons.fa - [For development](#for-development) - [Evaluation datasets](#evaluation-datasets) - [Contact](#contact) - - [Windows modification](#windows-modification) ## Introduction abPOA is an extended version of [Partial Order Alignment (POA](10.1093/bioinformatics/18.3.452)) diff --git a/abPOA.rc b/abPOA.rc index 8c5409c3d69e4530a6d7d683eaf9851bcc89296b..cc25b8c38e00f5f090ce0fd5254a81fb0533ab4f 100644 GIT binary patch delta 50 zcmZ3byh?e)CJsi^$(uP0fut^{n_seq; ++i) { + if (! abs->seq[i].l) + { + _err_simple_func_printf("Warning: Found a sequence length = 0. Program maybe generate wrong consensus sequence and wrong gfa."); + continue; + } + else if (abs->seq[i].l == 1 && abs->seq[i].s[0] == 13) + { + _err_simple_func_printf("Warning: Found a sequence length = 0. Program maybe generate wrong consensus sequence and wrong gfa."); + continue; + } if (abs->seq[i].l > max_len) max_len = abs->seq[i].l; } + if (max_len == 0) + { + if (abpt->out_cons) + err_printf("Warning: no consensus sequence generated.\n"); + if (abpt->out_gfa) + err_printf("Warning: no gfa generated.\n"); + if (abpt->out_msa) + { + for(i = 0; i < abs->n_seq; ++i) + { + if (abs->name[i].l + abs->comment[i].l > 0) { + fprintf(out_fp, ">%s %s\n", abs->name[i].l ? abs->name[i].s : "", abs->comment[i].l ? abs->comment[i].s : ""); + } else { + fprintf(out_fp, ">Seq_%d\n", i+1); + } + fputc('\n', out_fp); + } + } + return 0; + } // detect u and t int has_st = 0, has_su = 0; diff --git a/src/abpoa_output.c b/src/abpoa_output.c index 9f61327..8cc90ed 100644 --- a/src/abpoa_output.c +++ b/src/abpoa_output.c @@ -77,9 +77,9 @@ void abpoa_output_rc_msa(abpoa_t *ab, abpoa_para_t *abpt, FILE *out_fp) { abpoa_seq_t *abs = ab->abs; abpoa_cons_t *abc = ab->abc; if (abc->msa_len <= 0) return; for (i = 0; i < abs->n_seq; ++i) { - if (abs->name[i].l > 0) { - if (abs->is_rc[i]) fprintf(out_fp, ">%s_reverse_complement\n", abs->name[i].s); - else fprintf(out_fp, ">%s\n", abs->name[i].s); + if (abs->name[i].l + abs->comment[i].l > 0) { + if (abs->is_rc[i]) fprintf(out_fp, ">%s_reverse_complement %s\n", abs->name[i].l ? abs->name[i].s : "", abs->comment[i].l ? abs->comment[i].s : ""); + else fprintf(out_fp, ">%s %s\n", abs->name[i].l ? abs->name[i].s : "", abs->comment[i].l ? abs->comment[i].s : ""); } else { fprintf(out_fp, ">Seq_%d\n", i+1); } diff --git a/src/abpoa_profile.c b/src/abpoa_profile.c index fb58891..fd0f219 100644 --- a/src/abpoa_profile.c +++ b/src/abpoa_profile.c @@ -21,7 +21,7 @@ char PROG[20] = "abpoa_profile"; #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 profile-profile mode"; -char VERSION[20] = "1.4.1.4"; +char VERSION[20] = "1.4.1.5"; char CONTACT[30] = "gaoy1@chop.edu"; int need_prealign; diff --git a/test_data/all_0_len.fasta b/test_data/all_0_len.fasta new file mode 100644 index 0000000..e8644a0 --- /dev/null +++ b/test_data/all_0_len.fasta @@ -0,0 +1,5 @@ +> seq1 + +> seq2 + +> seq3 diff --git a/test_data/has_0_len.fasta b/test_data/has_0_len.fasta new file mode 100644 index 0000000..12f0fdb --- /dev/null +++ b/test_data/has_0_len.fasta @@ -0,0 +1,8 @@ +> seq1 + +> seq2 +AC +> seq3 + +> seq4 +AG \ No newline at end of file