Windows 8 で Eclipse を使用してコードを実行すると問題が発生します。以下のコードは、Linux の Eclipse ではスムーズに実行されますが、Windows 8 では実行されません。
package first
import org.biojava.bio.structure.Atom
import org.biojava.bio.structure.Structure
import org.biojava.bio.structure.StructureTools
import org.biojava.bio.structure.align.StructureAlignment
import org.biojava.bio.structure.align.StructureAlignmentFactory
import org.biojava.bio.structure.align.fatcat.FatCatRigid
import org.biojava.bio.structure.align.fatcat.calc.FatCatParameters
import org.biojava.bio.structure.align.gui.StructureAlignmentDisplay
import org.biojava.bio.structure.align.model.AFPChain
import org.biojava.bio.structure.align.util.AtomCache
import org.biojava.bio.structure.gui.BiojavaJmol
import org.biojava.bio.structure.align.gui.jmol.StructureAlignmentJmol
object Alignment {
def main(args: Array[String]){
val name1 = "1YYO.A"
val name2 = "1YYW.A"
val cache = new AtomCache()
val algorithm = StructureAlignmentFactory.getAlgorithm(FatCatRigid.algorithmName)
val ca1: Array[Atom] = StructureTools.getAtomCAArray(cache.getStructure(name1))
val ca2: Array[Atom] = StructureTools.getAtomCAArray(cache.getStructure(name2))
val params: FatCatParameters = new FatCatParameters()
val afpchain: AFPChain = algorithm.align(ca1, ca2, params)
afpchain.setName1(name1)
afpchain.setName2(name2)
println(afpchain.toFatcat(ca1,ca2))
StructureAlignmentDisplay.display(afpchain, ca1, ca2)
}
}
基本的にgetStructure
、メソッドは PDB ファイルをダウンロードしようとしますが、失敗して以下のエラーが発生します。
Problem while downloading PDB ID 1yyo from FTP server.
Failed URL: ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/yy/pdb1yyo.ent.gz
java.net.SocketException: Network is unreachable: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at sun.net.ftp.impl.FtpClient.openPassiveDataConnection(FtpClient.java:671)
at sun.net.ftp.impl.FtpClient.openDataConnection(FtpClient.java:710)
at sun.net.ftp.impl.FtpClient.getFileStream(FtpClient.java:1284)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:428)
at java.net.URL.openStream(URL.java:1037)
at org.biojava.bio.structure.io.util.FileDownloadUtils.downloadGzipCompressedFile(FileDownloadUtils.java:96)
at org.biojava.bio.structure.io.PDBFileReader.downloadPDB(PDBFileReader.java:677)
at org.biojava.bio.structure.io.PDBFileReader.downloadAndGetInputStream(PDBFileReader.java:795)
at org.biojava.bio.structure.io.PDBFileReader.getInputStream(PDBFileReader.java:433)
at org.biojava.bio.structure.io.PDBFileReader.getStructureById(PDBFileReader.java:875)
at org.biojava.bio.structure.align.util.AtomCache.loadStructureFromPdbByPdbId(AtomCache.java:1173)
at org.biojava.bio.structure.align.util.AtomCache.getStructure(AtomCache.java:501)
at first.Alignment$.main(Alignment.scala:24)
at first.Alignment.main(Alignment.scala)
problem loading:1YYO.A
JDKを再インストールして更新しようとしましたが、ファイアウォールをオフにして追加しまし-Djava.net.preferIPv4Stack=true
たが、それでも問題を解決できません。どんな提案でも大歓迎です。よろしくお願いします!