abutils
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: abutils | ||
| Version: 0.4.15 | ||
| Version: 0.4.16 | ||
| Summary: Utilities for analysis of adaptive immune receptor repertoire (AIRR) data | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/briney/abutils |
@@ -1027,1 +1027,44 @@ #!/usr/bin/env python | ||
| return fastq_file | ||
| def to_csv( | ||
| sequences: Iterable[Sequence], | ||
| csv_file: str, | ||
| sep: str = ",", | ||
| header: bool = True, | ||
| columns: Optional[Iterable] = None, | ||
| index: bool = False, | ||
| ) -> None: | ||
| """ | ||
| Saves a list of ``Sequence`` objects to a CSV file. | ||
| Parameters | ||
| ---------- | ||
| sequences : Iterable[Sequence] | ||
| List of ``Sequence`` objects to be saved to a CSV file. Required. | ||
| csv_file : str | ||
| Path to the output CSV file. Required. | ||
| sep : str, default="," | ||
| Column delimiter. Default is ``","``. | ||
| header : bool, default=True | ||
| If ``True``, the CSV file will contain a header row. Default is ``True``. | ||
| columns : list, default=None | ||
| A list of fields to be retained in the output CSV file. Fields must be column | ||
| names in the input file. | ||
| index : bool, default=False | ||
| If ``True``, the CSV file will contain an index column. Default is ``False``. | ||
| """ | ||
| d = [] | ||
| for s in sequences: | ||
| if not s.annotations: | ||
| d.append({"sequence_id": s.id, "sequence": s.sequence}) | ||
| else: | ||
| d.append(s.annotations) | ||
| df = pd.DataFrame(d) | ||
| df.to_csv(csv_file, sep=sep, index=index, columns=columns, header=header) |
+6
-7
@@ -28,12 +28,12 @@ #!/usr/bin/env python | ||
| from .core.sequence import ( | ||
| from_mongodb, | ||
| read_airr, | ||
| read_csv, | ||
| read_airr, | ||
| read_fasta, | ||
| read_fastq, | ||
| read_json, | ||
| from_mongodb, | ||
| to_csv, | ||
| to_fasta, | ||
| to_fastq, | ||
| ) | ||
| from .utils.convert import abi_to_fasta | ||
@@ -67,3 +67,3 @@ from .utils.pipeline import list_files, make_dir | ||
| sep (str): character used to separate fields in ``'tabular'`` input files. This option is | ||
| only used when ``format`` is ``'tabular'``. Default is ``'\t'``, which conforms with the | ||
| only used when ``format`` is ``'tabular'``. Default is ``'\t'``, which conforms with the | ||
| default format for AIRR-compatible sequence annotation. | ||
@@ -79,6 +79,6 @@ | ||
| mongodb_kwargs (dict): dictionary containing additional keyword arguments that will be passed to | ||
| mongodb_kwargs (dict): dictionary containing additional keyword arguments that will be passed to | ||
| ``abutils.io.from_mongodb``. | ||
| Returns: | ||
@@ -118,2 +118,1 @@ -------- | ||
| raise ValueError(error) | ||
@@ -6,2 +6,2 @@ # Store the version here so: | ||
| __version__ = "0.4.15" | ||
| __version__ = "0.4.16" |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: abutils | ||
| Version: 0.4.15 | ||
| Version: 0.4.16 | ||
| Summary: Utilities for analysis of adaptive immune receptor repertoire (AIRR) data | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/briney/abutils |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
233828822
021228
0.17%