How to open .SW files on Linux

To open .SW files on Linux, if your desktop labels .sw as chemical/x-swissprot, try opening it in a text editor first to confirm it is a UniProt/Swiss-Prot flat file; otherwise treat it as raw audio.

Step-by-step instructions

  1. If your desktop labels .sw as chemical/x-swissprot, try opening it in a text editor first to confirm it is a UniProt/Swiss-Prot flat file; otherwise treat it as raw audio.
  2. For Swiss-Prot/UniProt flat files: process with Biopython (SwissProt/“swiss”) or other bioinformatics tools; viewing is possible in any text editor.
  3. For raw PCM audio: import as “raw” PCM in an audio application and manually set signed 16-bit plus sample rate/channels (raw audio has no header to auto-detect).

Common issues

The .sw file opens as “unknown” or with the wrong app

The .sw extension is ambiguous (Swiss-Prot/UniProt data vs raw PCM audio), and OS file associations may map it to a Swiss-Prot MIME type even when the content is different.

  1. Open a copy in a plain text editor: UniProt/Swiss-Prot flat files are readable text records; raw PCM audio will not look like structured text.
  2. If it is Swiss-Prot/UniProt text, process it with a UniProt-aware parser such as Biopython’s SwissProt/“swiss” support; if it is audio, import it as raw PCM in an audio tool and set parameters manually.

Raw .sw audio plays as noise or at the wrong speed

Raw PCM has no header, so the player cannot know the sample rate, number of channels, or exact encoding; incorrect settings produce noise, distortion, or wrong playback speed.

  1. Re-import the file as raw audio and confirm it is signed 16-bit PCM (as documented for .sw audio).
  2. Try the correct sample rate/channels from the source workflow; if unknown, test common sample rates (e.g., 44100 or 48000 Hz) and mono vs stereo until it sounds right.

Bioinformatics parser fails or stops mid-file

Swiss-Prot/UniProt flat files are structured records; truncation or non-conformant formatting can cause parsers to error.

  1. Verify the download/transfer completed and the file is not truncated.
  2. Validate against UniProt’s flat file format documentation and re-export/re-download from the original source if possible.

Linux shows MIME type chemical/x-swissprot but the file is not UniProt data

On Linux, shared-mime-info can associate extensions with MIME types using installed rules; this is extension-based and may not reflect the actual content.

  1. Inspect the file content (text vs binary) rather than relying on the MIME label alone.
  2. If needed, open it with an app that lets you explicitly choose “import raw audio” or “open as text,” depending on what the file actually contains.

Security note

Swiss-Prot/UniProt flat files are plain text data, but treat them as untrusted input for scripts and parsers: a malformed file can trigger bugs or excessive resource use in downstream tooling (e.g., parsers).

Back to .SW extension page