Skip to content

Commit

Permalink
Allow csv to handle all newlines (#316)
Browse files Browse the repository at this point in the history
* Add 9-species model weights link to FAQ (#303)

* Add model weights link

* Generate new screengrabs with rich-codex

* Clarify that these weights should only be used for benchmarking

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Wout Bittremieux <[email protected]>

* Add FAQ entry about antibody sequencing (#304)

* Add FAQ entry about antibody sequencing

* Generate new screengrabs with rich-codex

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Melih Yilmaz <[email protected]>

* Allow csv to handle all newlines

The `csv` module tries to handle newlines itself. On Windows, this leads to line endings of `\r\r\n` instead of `\r\n`.

Setting `newline=''` produces the intended output on both platforms.

* Update CHANGELOG.md

* Fix linting issue

* Delete docs/images/help.svg

---------

Co-authored-by: Melih Yilmaz <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Wout Bittremieux <[email protected]>
Co-authored-by: William Stafford Noble <[email protected]>
Co-authored-by: Wout Bittremieux <[email protected]>
  • Loading branch information
6 people authored Mar 25, 2024
1 parent 6eabd6e commit cac0f4e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 60 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed

- Fix beam search caching failure when multiple beams have an equal predicted peptide score by breaking ties randomly.
- The mzTab output file now has proper line endings regardless of platform, fixing the extra `\r` found when run on Windows.

## [4.1.0] - 2024-02-16

Expand Down
2 changes: 1 addition & 1 deletion casanovo/data/ms_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def save(self) -> None:
"""
Export the spectrum identifications to the mzTab file.
"""
with open(self.filename, "w") as f:
with open(self.filename, "w", newline="") as f:
writer = csv.writer(f, delimiter="\t", lineterminator=os.linesep)
# Write metadata.
for row in self.metadata:
Expand Down
59 changes: 0 additions & 59 deletions docs/images/help.svg

This file was deleted.

0 comments on commit cac0f4e

Please sign in to comment.